--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Copyright (c) 2018 Xoriant Corporation and others. 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
+-->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <parent>
+ <groupId>org.opendaylight.mdsal</groupId>
+ <artifactId>binding-parent</artifactId>
+ <version>3.0.8</version>
+ <relativePath/>
+ </parent>
+
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.opendaylight.unimgr</groupId>
+ <artifactId>bgp-api</artifactId>
+ <version>0.5.0-SNAPSHOT</version>
+
+ <packaging>bundle</packaging>
+ <!-- <name> formatting is used by autorelease to parse and notify projects on
+ build failure. Please do not modify this unless you have a good reason. -->
+ <name>ODL :: unimgr :: ${project.artifactId}</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.opendaylight.mdsal.binding.model.ietf</groupId>
+ <artifactId>rfc6991</artifactId>
+ <version>1.2.8</version>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.mdsal.binding.model.ietf</groupId>
+ <artifactId>rfc8345-ietf-network-topology</artifactId>
+ <version>1.2.6</version>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.mdsal.model</groupId>
+ <artifactId>yang-ext</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.mdsal.binding.model.ietf</groupId>
+ <artifactId>rfc8349-ietf-routing</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.mdsal.binding.model.ietf</groupId>
+ <artifactId>rfc8294-ietf-routing-types</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.mdsal.binding.model.iana</groupId>
+ <artifactId>iana-if-type</artifactId>
+ <version>1.0.8</version>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.mdsal.binding.model.ietf</groupId>
+ <artifactId>rfc7223</artifactId>
+ <version>1.2.8</version>
+ </dependency>
+ </dependencies>
+</project>
--- /dev/null
+module iana-bfd-types {
+
+ yang-version 1.1;
+
+ namespace "urn:ietf:params:xml:ns:yang:iana-bfd-types";
+
+ prefix "iana-bfd-types";
+
+ organization "IANA";
+
+ contact
+ " Internet Assigned Numbers Authority
+
+ Postal: ICANN
+ 12025 Waterfront Drive, Suite 300
+ Los Angeles, CA 90094-2536
+ United States of America
+
+ Tel: +1 310 823 9358
+ <mailto:iana@iana.org>";
+
+ description
+ "This module defines YANG data types for IANA-registered
+ BFD parameters.
+
+ This YANG module is maintained by IANA and reflects the
+ 'BFD Diagnostic Codes' and 'BFD Authentication Types' registries.
+
+ Copyright (c) 2018 IETF Trust and the persons
+ identified as authors of the code. All rights reserved.
+
+ Redistribution and use in source and binary forms, with or
+ without modification, is permitted pursuant to, and subject
+ to the license terms contained in, the Simplified BSD License
+ set forth in Section 4.c of the IETF Trust's Legal Provisions
+ Relating to IETF Documents
+ (http://trustee.ietf.org/license-info).
+
+ This version of this YANG module is part of RFC XXXX; see
+ the RFC itself for full legal notices.";
+
+ // RFC Ed.: replace XXXX with actual RFC number and remove
+ // this note
+
+ reference "RFC XXXX";
+
+ revision 2018-08-01 {
+ description "Initial revision.";
+ reference "RFC XXXX: IANA BFD YANG Data Types.";
+ }
+
+ /*
+ * Type Definitions
+ */
+ typedef diagnostic {
+ type enumeration {
+ enum none {
+ value 0;
+ description "None";
+ }
+ enum control-expiry {
+ value 1;
+ description "Control timer expiry";
+ }
+ enum echo-failed {
+ value 2;
+ description "Echo failure";
+ }
+ enum neighbor-down {
+ value 3;
+ description "Neighbor down";
+ }
+ enum forwarding-reset {
+
+ value 4;
+ description "Forwarding reset";
+ }
+ enum path-down {
+ value 5;
+ description "Path down";
+ }
+ enum concatenated-path-down {
+ value 6;
+ description "Concatenated path down";
+ }
+ enum admin-down {
+ value 7;
+ description "Admin down";
+ }
+ enum reverse-concatenated-path-down {
+ value 8;
+ description "Reverse concatenated path down";
+ }
+ enum mis-connectivity-defect {
+ value 9;
+ description "Mis-connectivity defect as specified in RFC6428";
+ }
+ }
+ description
+ "BFD diagnostic as defined in RFC 5880, values are maintained in
+ the 'BFD Diagnostic Codes' IANA registry. Range is 0 to 31.";
+ }
+
+ typedef auth-type {
+ type enumeration {
+ enum reserved {
+ value 0;
+ description "Reserved";
+ }
+ enum simple-password {
+ value 1;
+ description "Simple password";
+ }
+ enum keyed-md5 {
+ value 2;
+ description "Keyed MD5";
+ }
+ enum meticulous-keyed-md5 {
+ value 3;
+ description "Meticulous keyed MD5";
+ }
+ enum keyed-sha1 {
+
+ value 4;
+ description "Keyed SHA1";
+ }
+ enum meticulous-keyed-sha1 {
+ value 5;
+ description "Meticulous keyed SHA1";
+ }
+ }
+ description
+ "BFD authentication type as defined in RFC 5880, values are
+ maintained in the 'BFD Authentication Types' IANA registry.
+ Range is 0 to 255.";
+ }
+}
+
--- /dev/null
+module ieee802-dot1q-types {
+ namespace urn:ieee:std:802.1Q:yang:ieee802-dot1q-types;
+ prefix dot1q-types;
+ import ietf-yang-types {
+ prefix yang;
+ }
+ organization
+ "IEEE 802.1 Working Group";
+ contact
+ "WG-URL: http://www.ieee802.org/1/
+ WG-EMail: stds-802-1-L@ieee.org
+
+ Contact: IEEE 802.1 Working Group Chair
+ Postal: C/O IEEE 802.1 Working Group
+ IEEE Standards Association
+ 445 Hoes Lane
+ P.O. Box 1331
+ Piscataway
+ NJ 08855-1331
+ USA
+
+ E-mail: STDS-802-1-L@IEEE.ORG";
+ description
+ "Common types used within dot1Q-bridge modules.";
+ revision 2018-03-07 {
+ description
+ "Published as part of IEEE Std 802.1Q-2018.
+ Initial version.";
+ reference
+ "IEEE Std 802.1Q-2018, Bridges and Bridged Networks.";
+ }
+
+ identity dot1q-vlan-type {
+ description
+ "Base identity from which all 802.1Q VLAN tag types are derived
+ from.";
+ }
+ identity c-vlan {
+ base dot1q-vlan-type;
+ description
+ "An 802.1Q Customer VLAN, using the 81-00 EtherType";
+ reference
+ "5.5 of IEEE Std 802.1Q-2018";
+ }
+ identity s-vlan {
+ base dot1q-vlan-type;
+ description
+ "An 802.1Q Service VLAN, using the 88-A8 EtherType originally
+ introduced in 802.1ad, and incorporated into 802.1Q (2011)";
+ reference
+ "5.6 of IEEE Std 802.1Q-2018";
+ }
+ typedef name-type {
+ type string {
+ length "0..32";
+ }
+ description
+ "A text string of up to 32 characters, of locally determined
+ significance.";
+ }
+ typedef port-number-type {
+ type uint32 {
+ range "1..65535";
+ }
+ description
+ "The port number of the Bridge port for which this entry
+ contains Bridge management information.";
+ }
+ typedef priority-type {
+ type uint8 {
+ range "0..7";
+ }
+ description
+ "A range of priorities from 0 to 7 (inclusive). The Priority
+ Code Point (PCP) is a 3-bit field that refers to the class of
+ service associated with an 802.1Q VLAN tagged frame. The field
+ specifies a priority value between 0 and 7, these values can be
+ used by quality of service (QoS) to prioritize different classes
+ of traffic.";
+ }
+ typedef vid-range-type {
+ type string {
+ pattern
+ "([1-9]"+
+ "[0-9]{0,3}"+
+ "(-[1-9][0-9]{0,3})?"+
+ "(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)";
+ }
+ description
+ "A list of VLAN Ids, or non overlapping VLAN ranges, in
+ ascending order, between 1 and 4094.
+
+ This type is used to match an ordered list of VLAN Ids, or
+ contiguous ranges of VLAN Ids. Valid VLAN Ids must be in the
+ range 1 to 4094, and included in the list in non overlapping
+ ascending order.
+
+ For example: 1,10-100,250,500-1000";
+ }
+ typedef vlanid {
+ type uint16 {
+ range "1..4094";
+ }
+ description
+ "The vlanid type uniquely identifies a VLAN. This is the 12-bit
+ VLAN-ID used in the VLAN Tag header. The range is defined by the
+ referenced specification. This type is in the value set and its
+ semantics equivalent to the VlanId textual convention of the
+ SMIv2.";
+ }
+ typedef vlan-index-type {
+ type uint32 {
+ range "1..4094 | 4096..4294967295";
+ }
+ description
+ "A value used to index per-VLAN tables. Values of 0 and 4095 are
+ not permitted. The range of valid VLAN indices. If the value is
+ greater than 4095, then it represents a VLAN with scope local to
+ the particular agent, i.e., one without a global VLAN-ID
+ assigned to it. Such VLANs are outside the scope of IEEE 802.1Q,
+ but it is convenient to be able to manage them in the same way
+ using this YANG module.";
+ reference
+ "9.6 of IEEE Std 802.1Q-2018";
+ }
+ typedef mstid-type {
+ type uint32 {
+ range "1..4094";
+ }
+ description
+ "In an MSTP Bridge, an MSTID, i.e., a value used to identify a
+ spanning tree (or MST) instance";
+ reference
+ "13.8 of IEEE Std 802.1Q-2018";
+ }
+ typedef pcp-selection-type {
+ type enumeration {
+ enum 8P0D {
+ description
+ "8 priorities, 0 drop eligible";
+ }
+ enum 7P1D {
+ description
+ "7 priorities, 1 drop eligible";
+ }
+ enum 6P2D {
+ description
+ "6 priorities, 2 drop eligible";
+ }
+ enum 5P3D {
+ description
+ "5 priorities, 3 drop eligible";
+ }
+ }
+ description
+ "Priority Code Point selection types.";
+ reference
+ "12.6.2.5.3 of IEEE Std 802.1Q-2018
+ 6.9.3 of IEEE Std 802.1Q-2018";
+ }
+ typedef protocol-frame-format-type {
+ type enumeration {
+ enum Ethernet {
+ description
+ "Ethernet frame format";
+ }
+ enum rfc1042 {
+ description
+ "RFC 1042 frame format";
+ }
+ enum snap8021H {
+ description
+ "SNAP 802.1H frame format";
+ }
+ enum snapOther {
+ description
+ "Other SNAP frame format";
+ }
+ enum llcOther {
+ description
+ "Other LLC frame format";
+ }
+ }
+ description
+ "A value representing the frame format to be matched.";
+ reference
+ "12.10.1.7.1 of IEEE Std 802.1Q-2018";
+ }
+ typedef ethertype-type {
+ type string {
+ pattern "[0-9a-fA-F]{2}-[0-9a-fA-F]{2}";
+ }
+ description
+ "The EtherType value represented in the canonical order defined
+ by IEEE 802. The canonical representation uses uppercase
+ characters.";
+ reference
+ "9.2 of IEEE Std 802-2014";
+ }
+ typedef dot1q-tag-type {
+ type identityref {
+ base dot1q-vlan-type;
+ }
+ description
+ "Identifies a specific 802.1Q tag type";
+ reference
+ "IEEE Std 802.1Q-2018";
+ }
+ typedef traffic-class-type {
+ type uint8 {
+ range "0..7";
+ }
+ description
+ "This is the numerical value associated with a traffic class in
+ a Bridge. Larger values are associated with higher priority
+ traffic classes.";
+ reference
+ "3.239 of IEEE Std 802.1Q-2018";
+ }
+ grouping dot1q-tag-classifier-grouping {
+ description
+ "A grouping which represents an 802.1Q VLAN, matching both the
+ EtherType and a single VLAN Id.";
+ leaf tag-type {
+ type dot1q-tag-type;
+ mandatory true;
+ description
+ "VLAN type";
+ }
+ leaf vlan-id {
+ type vlanid;
+ mandatory true;
+ description
+ "VLAN Id";
+ }
+ }
+ grouping dot1q-tag-or-any-classifier-grouping {
+ description
+ "A grouping which represents an 802.1Q VLAN, matching both the
+ EtherType and a single VLAN Id or 'any' to match on any VLAN Id.";
+ leaf tag-type {
+ type dot1q-tag-type;
+ mandatory true;
+ description
+ "VLAN type";
+ }
+ leaf vlan-id {
+ type union {
+ type vlanid;
+ type enumeration {
+ enum any {
+ value 4095;
+ description
+ "Matches 'any' VLAN in the range 1 to 4094 that is not
+ matched by a more specific VLAN Id match";
+ }
+ }
+ }
+ mandatory true;
+ description
+ "VLAN Id or any";
+ }
+ }
+ grouping dot1q-tag-ranges-classifier-grouping {
+ description
+ "A grouping which represents an 802.1Q VLAN that matches a range
+ of VLAN Ids.";
+ leaf tag-type {
+ type dot1q-tag-type;
+ mandatory true;
+ description
+ "VLAN type";
+ }
+ leaf vlan-ids {
+ type vid-range-type;
+ mandatory true;
+ description
+ "VLAN Ids";
+ }
+ }
+ grouping dot1q-tag-ranges-or-any-classifier-grouping {
+ description
+ "A grouping which represents an 802.1Q VLAN, matching both the
+ EtherType and a single VLAN Id, ordered list of ranges, or 'any'
+ to match on any VLAN Id.";
+ leaf tag-type {
+ type dot1q-tag-type;
+ mandatory true;
+ description
+ "VLAN type";
+ }
+ leaf vlan-id {
+ type union {
+ type vid-range-type;
+ type enumeration {
+ enum any {
+ value 4095;
+ description
+ "Matches 'any' VLAN in the range 1 to 4094.";
+ }
+ }
+ }
+ mandatory true;
+ description
+ "VLAN Ids or any";
+ }
+ }
+ grouping priority-regeneration-table-grouping {
+ description
+ "The priority regeneration table provides the ability to map
+ incoming priority values on a per-Port basis, under management
+ control.";
+ reference
+ "6.9.4 of IEEE Std 802.1Q-2018";
+ leaf priority0 {
+ type priority-type;
+ default "0";
+ description
+ "Priority 0";
+ reference
+ "12.6.2.3 of IEEE Std 802.1Q-2018
+ 6.9.4 of IEEE Std 802.1Q-2018";
+ }
+ leaf priority1 {
+ type priority-type;
+ default "1";
+ description
+ "Priority 1";
+ reference
+ "12.6.2.3 of IEEE Std 802.1Q-2018
+ 6.9.4 of IEEE Std 802.1Q-2018";
+ }
+ leaf priority2 {
+ type priority-type;
+ default "2";
+ description
+ "Priority 2";
+ reference
+ "12.6.2.3 of IEEE Std 802.1Q-2018
+ 6.9.4 of IEEE Std 802.1Q-2018";
+ }
+ leaf priority3 {
+ type priority-type;
+ default "3";
+ description
+ "Priority 3";
+ reference
+ "12.6.2.3 of IEEE Std 802.1Q-2018
+ 6.9.4 of IEEE Std 802.1Q-2018";
+ }
+ leaf priority4 {
+ type priority-type;
+ default "4";
+ description
+ "Priority 4";
+ reference
+ "12.6.2.3 of IEEE Std 802.1Q-2018
+ 6.9.4 of IEEE Std 802.1Q-2018";
+ }
+ leaf priority5 {
+ type priority-type;
+ default "5";
+ description
+ "Priority 5";
+ reference
+ "12.6.2.3 of IEEE Std 802.1Q-2018
+ 6.9.4 of IEEE Std 802.1Q-2018";
+ }
+ leaf priority6 {
+ type priority-type;
+ default "6";
+ description
+ "Priority 6";
+ reference
+ "12.6.2.3 of IEEE Std 802.1Q-2018
+ 6.9.4 of IEEE Std 802.1Q-2018";
+ }
+ leaf priority7 {
+ type priority-type;
+ default "7";
+ description
+ "Priority 7";
+ reference
+ "12.6.2.3 of IEEE Std 802.1Q-2018
+ 6.9.4 of IEEE Std 802.1Q-2018";
+ }
+ }
+ grouping pcp-decoding-table-grouping {
+ description
+ "The Priority Code Point decoding table enables the decoding of
+ the priority and drop-eligible parameters from the PCP.";
+ reference
+ "6.9.3 of IEEE Std 802.1Q-2018";
+ list pcp-decoding-map {
+ key "type";
+ description
+ "This map associates the priority code point field found in
+ the VLAN to a priority and drop eligible value based upon the
+ priority code point selection type.";
+ leaf type {
+ type pcp-selection-type;
+ description
+ "The priority code point selection type.";
+ reference
+ "12.6.2.7 of IEEE Std 802.1Q-2018
+ 6.9.3 of IEEE Std 802.1Q-2018";
+ }
+ list priority-map {
+ key "point";
+ description
+ "This map associated a priority code point value to priority
+ and drop eligible parameters.";
+ leaf point {
+ type priority-type;
+ description
+ "Priority associated with the pcp.";
+ reference
+ "12.6.2.7 of IEEE Std 802.1Q-2018
+ 6.9.3 of IEEE Std 802.1Q-2018";
+ }
+ leaf priority {
+ type priority-type;
+ description
+ "Priority associated with the pcp.";
+ reference
+ "12.6.2.7 of IEEE Std 802.1Q-2018
+ 6.9.3 of IEEE Std 802.1Q-2018";
+ }
+ leaf drop-eligible {
+ type boolean;
+ description
+ "Drop eligible value for pcp";
+ reference
+ "12.6.2.7 of IEEE Std 802.1Q-2018
+ 6.9.3 of IEEE Std 802.1Q-2018";
+ }
+ }
+ }
+ }
+ grouping pcp-encoding-table-grouping {
+ description
+ "The Priority Code Point encoding table encodes the priority and
+ drop-eligible parameters in the PCP field of the VLAN tag.";
+ reference
+ "12.6.2.9 of IEEE Std 802.1Q-2018
+ 6.9.3 of IEEE Std 802.1Q-2018";
+ list pcp-encoding-map {
+ key "type";
+ description
+ "This map associated the priority and drop-eligible parameters
+ to the priority used to encode the PCP of the VLAN based upon
+ the priority code point selection type.";
+ leaf type {
+ type pcp-selection-type;
+ description
+ "The priority code point selection type.";
+ reference
+ "12.6.2.7 of IEEE Std 802.1Q-2018
+ 6.9.3 of IEEE Std 802.1Q-2018";
+ }
+ list priority-map {
+ key "type dei";
+ description
+ "This map associated the priority and drop-eligible
+ parameters to the priority code point field of the VLAN tag.";
+ leaf type {
+ type priority-type;
+ description
+ "Priority associated with the pcp.";
+ reference
+ "12.6.2.7 of IEEE Std 802.1Q-2018
+ 6.9.3 of IEEE Std 802.1Q-2018";
+ }
+ leaf dei {
+ type boolean;
+ description
+ "The drop eligible value.";
+ reference
+ "12.6.2 of IEEE Std 802.1Q-2018
+ 8.6.6 of IEEE Std 802.1Q-2018";
+ }
+ leaf priority-code-point {
+ type priority-type;
+ description
+ "PCP value for priority when DEI value";
+ reference
+ "12.6.2.9 of IEEE Std 802.1Q-2018
+ 6.9.3 of IEEE Std 802.1Q-2018";
+ }
+ }
+ }
+ }
+ grouping service-access-priority-table-grouping {
+ description
+ "The Service Access Priority Table associates a received
+ priority with a serice access priority.";
+ reference
+ "12.6.2.17 of IEEE Std 802.1Q-2018
+ 6.13.1 of IEEE Std 802.1Q-2018";
+ leaf priority0 {
+ type priority-type;
+ default "0";
+ description
+ "Service access priority value for priority 0";
+ reference
+ "12.6.2.17 of IEEE Std 802.1Q-2018
+ 6.13.1 of IEEE Std 802.1Q-2018";
+ }
+ leaf priority1 {
+ type priority-type;
+ default "1";
+ description
+ "Service access priority value for priority 1";
+ reference
+ "12.6.2.17 of IEEE Std 802.1Q-2018
+ 6.13.1 of IEEE Std 802.1Q-2018";
+ }
+ leaf priority2 {
+ type priority-type;
+ default "2";
+ description
+ "Service access priority value for priority 2";
+ reference
+ "12.6.2.17 of IEEE Std 802.1Q-2018
+ 6.13.1 of IEEE Std 802.1Q-2018";
+ }
+ leaf priority3 {
+ type priority-type;
+ default "3";
+ description
+ "Service access priority value for priority 3";
+ reference
+ "12.6.2.17 of IEEE Std 802.1Q-2018
+ 6.13.1 of IEEE Std 802.1Q-2018";
+ }
+ leaf priority4 {
+ type priority-type;
+ default "4";
+ description
+ "Service access priority value for priority 4";
+ reference
+ "12.6.2.17 of IEEE Std 802.1Q-2018
+ 6.13.1 of IEEE Std 802.1Q-2018";
+ }
+ leaf priority5 {
+ type priority-type;
+ default "5";
+ description
+ "Service access priority value for priority 5";
+ reference
+ "12.6.2.17 of IEEE Std 802.1Q-2018
+ 6.13.1 of IEEE Std 802.1Q-2018";
+ }
+ leaf priority6 {
+ type priority-type;
+ default "6";
+ description
+ "Service access priority value for priority 6";
+ reference
+ "12.6.2.17 of IEEE Std 802.1Q-2018
+ 6.13.1 of IEEE Std 802.1Q-2018";
+ }
+ leaf priority7 {
+ type priority-type;
+ default "7";
+ description
+ "Service access priority value for priority 7";
+ reference
+ "12.6.2.17 of IEEE Std 802.1Q-2018
+ 6.13.1 of IEEE Std 802.1Q-2018";
+ }
+ }
+ grouping traffic-class-table-grouping {
+ description
+ "The Traffic Class Table models the operations that can be
+ performed on, or inquire about, the current contents of the
+ Traffic Class Table (8.6.6) for a given Port.";
+ reference
+ "12.6.3 of IEEE Std 802.1Q-2018
+ 8.6.6 of IEEE Std 802.1Q-2018";
+ list traffic-class-map {
+ key "priority";
+ description
+ "The priority index into the traffic class table.";
+ leaf priority {
+ type priority-type;
+ description
+ "The priority of the traffic class entry.";
+ reference
+ "8.6.6 of IEEE Std 802.1Q-2018";
+ }
+ list available-traffic-class {
+ key "num-traffic-class";
+ description
+ "The traffic class index associated with a given priority
+ within the traffic class table.";
+ reference
+ "8.6.6 of IEEE Std 802.1Q-2018";
+ leaf num-traffic-class {
+ type uint8 {
+ range "1..8";
+ }
+ description
+ "The available number of traffic classes.";
+ reference
+ "8.6.6 of IEEE Std 802.1Q-2018";
+ }
+ leaf traffic-class {
+ type traffic-class-type;
+ description
+ "The traffic class index associated with a given traffic
+ class entry.";
+ reference
+ "8.6.6 of IEEE Std 802.1Q-2018";
+ }
+ }
+ }
+ }
+ grouping port-map-grouping {
+ description
+ "A set of control indicators, one for each Port. A Port Map,
+ containing a control element for each outbound Port";
+ reference
+ "8.8.1 of IEEE Std 802.1Q-2018
+ 8.8.2 of IEEE Std 802.1Q-2018";
+ list port-map {
+ key "ref";
+ description
+ "The list of entries composing the port map.";
+ leaf ref {
+ type port-number-type;
+ description
+ "The interface port reference associated with this map.";
+ reference
+ "8.8.1 of IEEE Std 802.1Q-2018";
+ }
+ choice map-type {
+ description
+ "Type of port map";
+ container static-filtering-entries {
+ description
+ "Static filtering entries attributes.";
+ leaf control-element {
+ type enumeration {
+ enum forward {
+ description
+ "Forwarded, independently of any dynamic filtering
+ information held by the FDB.";
+ }
+ enum filter {
+ description
+ "Filtered, independently of any dynamic filtering
+ information.";
+ }
+ enum forward-filter {
+ description
+ "Forwarded or filtered on the basis of dynamic
+ filtering information, or on the basis of the
+ default Group filtering behavior for the outbound
+ Port (8.8.6) if no dynamic filtering information is
+ present specifically for the MAC address.";
+ }
+ }
+ description
+ "containing a control element for each outbound Port,
+ specifying that a frame with a destination MAC address,
+ and in the case of VLAN Bridge components, VID that
+ meets this specification.";
+ reference
+ "8.8.1 of IEEE Std 802.1Q-2018";
+ }
+ leaf connection-identifier {
+ type port-number-type;
+ description
+ "A Port MAP may contain a connection identifier (8.8.12)
+ for each outbound port. The connection identifier may be
+ associated with the Bridge Port value maintained in a
+ Dynamic Filtering Entry of the FDB for Bridge Ports.";
+ reference
+ "8.8.1 of IEEE Std 802.1Q-2018
+ 8.8.12 of IEEE Std 802.1Q-2018";
+ }
+ }
+ container static-vlan-registration-entries {
+ description
+ "Static VLAN registration entries.";
+ leaf registrar-admin-control {
+ type enumeration {
+ enum fixed-new-ignored {
+ description
+ "Registration Fixed (New ignored).";
+ }
+ enum fixed-new-propagated {
+ description
+ "Registration Fixed (New propagated.";
+ }
+ enum forbidden {
+ description
+ "Registration Forbidden.";
+ }
+ enum normal {
+ description
+ "Normal Registration.";
+ }
+ }
+ description
+ "The Registrar Administrative Control values for MVRP
+ and MIRP for the VID.";
+ reference
+ "8.8.2 of IEEE Std 802.1Q-2018";
+ }
+ leaf vlan-transmitted {
+ type enumeration {
+ enum tagged {
+ description
+ "VLAN-tagged";
+ }
+ enum untagged {
+ description
+ "VLAN-untagged";
+ }
+ }
+ description
+ "Whether frames are to be VLAN-tagged or untagged when
+ transmitted.";
+ reference
+ "8.8.2 of IEEE Std 802.1Q-2018";
+ }
+ }
+ container mac-address-registration-entries {
+ description
+ "MAC address registration entries attributes.";
+ leaf control-element {
+ type enumeration {
+ enum registered {
+ description
+ "Forwarded, independently of any dynamic filtering
+ information held by the FDB.";
+ }
+ enum not-registered {
+ description
+ "Filtered, independently of any dynamic filtering
+ information.";
+ }
+ }
+ description
+ "containing a control element for each outbound Port,
+ specifying that a frame with a destination MAC address,
+ and in the case of VLAN Bridge components, VID that
+ meets this specification.";
+ reference
+ "8.8.4 of IEEE Std 802.1Q-2018";
+ }
+ }
+ container dynamic-vlan-registration-entries {
+ description
+ "Dynamic VLAN registration entries attributes.";
+ leaf control-element {
+ type enumeration {
+ enum registered {
+ description
+ "Forwarded, independently of any dynamic filtering
+ information held by the FDB.";
+ }
+ }
+ description
+ "containing a control element for each outbound Port,
+ specifying that a frame with a destination MAC address,
+ and in the case of VLAN Bridge components, VID that
+ meets this specification.";
+ reference
+ "8.8.5 of IEEE Std 802.1Q-2018";
+ }
+ }
+ container dynamic-reservation-entries {
+ description
+ "Dynamic reservation entries attributes.";
+ leaf control-element {
+ type enumeration {
+ enum forward {
+ description
+ "Forwarded, independently of any dynamic filtering
+ information held by the FDB.";
+ }
+ enum filter {
+ description
+ "Filtered, independently of any dynamic filtering
+ information.";
+ }
+ }
+ description
+ "Containing a control element for each outbound Port,
+ specifying that a frame with a destination MAC address,
+ and in the case of VLAN Bridge components, VID that
+ meets this specification.";
+ reference
+ "8.8.7 of IEEE Std 802.1Q-2018";
+ }
+ }
+ container dynamic-filtering-entries {
+ description
+ "Dynamic filtering entries attributes.";
+ leaf control-element {
+ type enumeration {
+ enum forward {
+ description
+ "Forwarded, independently of any dynamic filtering
+ information held by the FDB.";
+ }
+ }
+ description
+ "Containing a control element for each outbound Port,
+ specifying that a frame with a destination MAC address,
+ and in the case of VLAN Bridge components, VID that
+ meets this specification.";
+ reference
+ "8.8.3 of IEEE Std 802.1Q-2018";
+ }
+ }
+ }
+ }
+ }
+ grouping bridge-port-statistics-grouping {
+ description
+ "Grouping of bridge port statistics.";
+ reference
+ "12.6.1.1.3 of IEEE Std 802.1Q-2018";
+ leaf delay-exceeded-discards {
+ type yang:counter64;
+ description
+ "The number of frames discarded by this port due to excessive
+ transit delay through the Bridge. It is incremented by both
+ transparent and source route Bridges.";
+ reference
+ "12.6.1.1.3 of IEEE Std 802.1Q-2018
+ 8.6.6 of IEEE Std 802.1Q-2018";
+ }
+ leaf mtu-exceeded-discards {
+ type yang:counter64;
+ description
+ "The number of frames discarded by this port due to an
+ excessive size. It is incremented by both transparent and
+ source route Bridges.";
+ reference
+ "12.6.1.1.3, item g) of IEEE Std 802.1Q-2018";
+ }
+ leaf frame-rx {
+ type yang:counter64;
+ description
+ "The number of frames that have been received by this port
+ from its segment. Note that a frame received on the interface
+ corresponding to this port is only counted by this object if
+ and only if it is for a protocol being processed by the local
+ bridging function, including Bridge management frames.";
+ reference
+ "12.6.1.1.3 of IEEE Std 802.1Q-2018";
+ }
+ leaf octets-rx {
+ type yang:counter64;
+ description
+ "The total number of octets in all valid frames received
+ (including BPDUs, frames addressed to the Bridge as an end
+ station, and frames that were submitted to the Forwarding
+ Process).";
+ reference
+ "12.6.1.1.3 of IEEE Std 802.1Q-2018";
+ }
+ leaf frame-tx {
+ type yang:counter64;
+ description
+ "The number of frames that have been transmitted by this port
+ to its segment. Note that a frame transmitted on the interface
+ corresponding to this port is only counted by this object if
+ and only if it is for a protocol being processed by the local
+ bridging function, including Bridge management frames.";
+ }
+ leaf octets-tx {
+ type yang:counter64;
+ description
+ "The total number of octets that have been transmitted by this
+ port to its segment.";
+ }
+ leaf discard-inbound {
+ type yang:counter64;
+ description
+ "Count of received valid frames that were discarded (i.e.,
+ filtered) by the Forwarding Process.";
+ reference
+ "12.6.1.1.3 of IEEE Std 802.1Q-2018";
+ }
+ leaf forward-outbound {
+ type yang:counter64;
+ description
+ "The number of frames forwarded to the associated MAC Entity
+ (8.5).";
+ reference
+ "12.6.1.1.3 of IEEE Std 802.1Q-2018";
+ }
+ leaf discard-lack-of-buffers {
+ type yang:counter64;
+ description
+ "The count of frames that were to be transmitted through the
+ associated Port but were discarded due to lack of buffers.";
+ reference
+ "12.6.1.1.3 of IEEE Std 802.1Q-2018";
+ }
+ leaf discard-transit-delay-exceeded {
+ type yang:counter64;
+ description
+ "The number of frames discarded by this port due to excessive
+ transit delay through the Bridge. It is incremented by both
+ transparent and source route Bridges.";
+ reference
+ "12.6.1.1.3 of IEEE Std 802.1Q-2018";
+ }
+ leaf discard-on-error {
+ type yang:counter64;
+ description
+ "The number of frames that were to be forwarded on the
+ associated MAC but could not be transmitted (e.g., frame would
+ be too large, 6.5.8).";
+ reference
+ "12.6.1.1.3 of IEEE Std 802.1Q-2018";
+ }
+ }
+}
--- /dev/null
+module ietf-bfd-types {
+
+ yang-version 1.1;
+
+ namespace "urn:ietf:params:xml:ns:yang:ietf-bfd-types";
+
+ prefix "bfd-types";
+
+ // RFC Ed.: replace occurences of XXXX with actual RFC number and
+ // remove this note
+
+ import iana-bfd-types {
+ prefix "iana-bfd-types";
+ reference "RFC XXXX: YANG Data Model for BFD";
+ }
+
+ import ietf-inet-types {
+ prefix "inet";
+ reference "RFC 6991: Common YANG Data Types";
+ }
+
+ import ietf-yang-types {
+ prefix "yang";
+ reference "RFC 6991: Common YANG Data Types";
+
+ }
+
+ import ietf-routing {
+ prefix "rt";
+ reference
+ "RFC 8349: A YANG Data Model for Routing Management
+ (NMDA version)";
+ }
+
+ import ietf-key-chain {
+ prefix "kc";
+ reference "RFC 8177: YANG Data Model for Key Chains";
+ }
+
+ organization "IETF BFD Working Group";
+
+ contact
+ "WG Web: <http://tools.ietf.org/wg/bfd>
+ WG List: <rtg-bfd@ietf.org>
+
+ Editors: Reshad Rahman (rrahman@cisco.com),
+ Lianshu Zheng (vero.zheng@huawei.com),
+ Mahesh Jethanandani (mjethanandani@gmail.com)";
+
+ description
+ "This module contains a collection of BFD specific YANG data type
+ definitions, as per RFC 5880, and also groupings which are common
+ to other BFD YANG modules.
+
+ Copyright (c) 2018 IETF Trust and the persons
+ identified as authors of the code. All rights reserved.
+
+ Redistribution and use in source and binary forms, with or
+ without modification, is permitted pursuant to, and subject
+ to the license terms contained in, the Simplified BSD License
+ set forth in Section 4.c of the IETF Trust's Legal Provisions
+ Relating to IETF Documents
+ (http://trustee.ietf.org/license-info).
+
+ This version of this YANG module is part of RFC XXXX; see
+ the RFC itself for full legal notices.";
+
+ reference "RFC XXXX";
+
+ revision 2018-08-01 {
+ description "Initial revision.";
+ reference "RFC XXXX: YANG Data Model for BFD";
+ }
+
+ /*
+ * Feature definitions
+ */
+ feature single-minimum-interval {
+ description
+ "This feature indicates that the server supports configuration
+ of one minimum interval value which is used for both transmit and
+ receive minimum intervals.";
+ }
+
+ feature authentication {
+ description
+ "This feature indicates that the server supports BFD
+ authentication.";
+ reference
+ "RFC 5880: Bidirectional Forwarding Detection (BFD),
+ section 6.7.";
+ }
+
+ feature demand-mode {
+ description
+ "This feature indicates that the server supports BFD demand
+ mode.";
+ reference
+ "RFC 5880: Bidirectional Forwarding Detection (BFD),
+ section 6.6.";
+ }
+
+ feature echo-mode {
+ description
+ "This feature indicates that the server supports BFD echo
+ mode.";
+ reference
+ "RFC 5880: Bidirectional Forwarding Detection (BFD),
+ section 6.4.";
+ }
+
+ /*
+ * Identity definitions
+ */
+ identity bfdv1 {
+ base "rt:control-plane-protocol";
+ description "BFD protocol version 1.";
+ reference
+ "RFC 5880: Bidirectional Forwarding Detection (BFD).";
+ }
+
+ identity path-type {
+
+ description
+ "Base identity for BFD path type. The path type indicates
+ the type of path on which BFD is running.";
+ }
+ identity path-ip-sh {
+ base path-type;
+ description "BFD on IP single hop.";
+ reference
+ "RFC 5881: Bidirectional Forwarding Detection (BFD)
+ for IPv4 and IPv6 (Single Hop).";
+ }
+ identity path-ip-mh {
+ base path-type;
+ description "BFD on IP multihop paths.";
+ reference
+ "RFC 5883: Bidirectional Forwarding Detection (BFD) for
+ Multihop Paths.";
+ }
+ identity path-mpls-te {
+ base path-type;
+ description
+ "BFD on MPLS Traffic Engineering.";
+ reference
+ "RFC 5884: Bidirectional Forwarding Detection (BFD)
+ for MPLS Label Switched Paths (LSPs).";
+ }
+ identity path-mpls-lsp {
+ base path-type;
+ description
+ "BFD on MPLS Label Switched Path.";
+ reference
+ "RFC 5884: Bidirectional Forwarding Detection (BFD)
+ for MPLS Label Switched Paths (LSPs).";
+ }
+ identity path-lag {
+ base path-type;
+ description
+ "Micro-BFD on LAG member links.";
+ reference
+ "RFC 7130: Bidirectional Forwarding Detection (BFD) on
+ Link Aggregation Group (LAG) Interfaces.";
+ }
+
+ identity encap-type {
+ description
+ "Base identity for BFD encapsulation type.";
+ }
+ identity encap-ip {
+
+ base encap-type;
+ description "BFD with IP encapsulation.";
+ }
+
+ /*
+ * Type Definitions
+ */
+ typedef discriminator {
+ type uint32;
+ description "BFD discriminator as described in RFC 5880.";
+ }
+
+ typedef state {
+ type enumeration {
+ enum adminDown {
+ value 0;
+ description "admindown";
+ }
+ enum down {
+ value 1;
+ description "down";
+ }
+ enum init {
+ value 2;
+ description "init";
+ }
+ enum up {
+ value 3;
+ description "up";
+ }
+ }
+ description "BFD state as defined in RFC 5880.";
+ }
+
+ typedef multiplier {
+ type uint8 {
+ range 1..255;
+ }
+ description "BFD multiplier as described in RFC 5880.";
+ }
+
+ typedef hops {
+ type uint8 {
+ range 1..255;
+ }
+ description
+ "This corresponds to Time To Live for IPv4 and corresponds to hop
+ limit for IPv6.";
+
+ }
+
+ /*
+ * Groupings
+ */
+ grouping auth-parms {
+ description
+ "Grouping for BFD authentication parameters
+ (see section 6.7 of RFC 5880).";
+ container authentication {
+ if-feature authentication;
+ presence
+ "Enables BFD authentication (see section 6.7 of RFC 5880).";
+ description "Parameters for BFD authentication.";
+
+ leaf key-chain {
+ type kc:key-chain-ref;
+ description "Name of the key-chain as per RFC 8177.";
+ }
+
+ leaf meticulous {
+ type boolean;
+ description
+ "Enables meticulous mode as described in section 6.7 " +
+ "of RFC 5880.";
+ }
+ }
+ }
+
+ grouping base-cfg-parms {
+ description "BFD grouping for base config parameters.";
+ leaf local-multiplier {
+ type multiplier;
+ default 3;
+ description "Multiplier transmitted by local system.";
+ }
+
+ choice interval-config-type {
+ description
+ "Two interval values or one value used for both transmit and
+ receive.";
+ case tx-rx-intervals {
+ leaf desired-min-tx-interval {
+ type uint32;
+ units microseconds;
+ default 1000000;
+ description
+ "Desired minimum transmit interval of control packets.";
+
+ }
+
+ leaf required-min-rx-interval {
+ type uint32;
+ units microseconds;
+ default 1000000;
+ description
+ "Required minimum receive interval of control packets.";
+ }
+ }
+ case single-interval {
+ if-feature single-minimum-interval;
+
+ leaf min-interval {
+ type uint32;
+ units microseconds;
+ default 1000000;
+ description
+ "Desired minimum transmit interval and required " +
+ "minimum receive interval of control packets.";
+ }
+ }
+ }
+ }
+
+ grouping client-cfg-parms {
+ description
+ "BFD grouping for configuration parameters
+ used by clients of BFD, e.g. IGP or MPLS.";
+
+ leaf enable {
+ type boolean;
+ default false;
+ description
+ "Indicates whether the BFD is enabled.";
+ }
+ uses base-cfg-parms;
+ }
+
+ grouping common-cfg-parms {
+ description
+ "BFD grouping for common configuration parameters.";
+
+ uses base-cfg-parms;
+
+ leaf demand-enabled {
+ if-feature demand-mode;
+ type boolean;
+
+ default false;
+ description
+ "To enable demand mode.";
+ }
+
+ leaf admin-down {
+ type boolean;
+ default false;
+ description
+ "Is the BFD session administratively down.";
+ }
+ uses auth-parms;
+ }
+
+ grouping all-session {
+ description "BFD session operational information";
+ leaf path-type {
+ type identityref {
+ base path-type;
+ }
+ config "false";
+ description
+ "BFD path type, this indicates the path type that BFD is
+ running on.";
+ }
+ leaf ip-encapsulation {
+ type boolean;
+ config "false";
+ description "Whether BFD encapsulation uses IP.";
+ }
+ leaf local-discriminator {
+ type discriminator;
+ config "false";
+ description "Local discriminator.";
+ }
+ leaf remote-discriminator {
+ type discriminator;
+ config "false";
+ description "Remote discriminator.";
+ }
+ leaf remote-multiplier {
+ type multiplier;
+ config "false";
+ description "Remote multiplier.";
+ }
+ leaf demand-capability {
+ if-feature demand-mode;
+ type boolean;
+
+ config "false";
+ description "Local demand mode capability.";
+ }
+ leaf source-port {
+ when "../ip-encapsulation = 'true'" {
+ description
+ "Source port valid only when IP encapsulation is used.";
+ }
+ type inet:port-number;
+ config "false";
+ description "Source UDP port";
+ }
+ leaf dest-port {
+ when "../ip-encapsulation = 'true'" {
+ description
+ "Destination port valid only when IP encapsulation is used.";
+ }
+ type inet:port-number;
+ config "false";
+ description "Destination UDP port.";
+ }
+
+ container session-running {
+ config "false";
+ description "BFD session running information.";
+ leaf session-index {
+ type uint32;
+ description
+ "An index used to uniquely identify BFD sessions.";
+ }
+ leaf local-state {
+ type state;
+ description "Local state.";
+ }
+ leaf remote-state {
+ type state;
+ description "Remote state.";
+ }
+ leaf local-diagnostic {
+ type iana-bfd-types:diagnostic;
+ description "Local diagnostic.";
+ }
+ leaf remote-diagnostic {
+ type iana-bfd-types:diagnostic;
+ description "Remote diagnostic.";
+ }
+ leaf remote-authenticated {
+ type boolean;
+
+ description
+ "Indicates whether incoming BFD control packets are
+ authenticated.";
+ }
+ leaf remote-authentication-type {
+ when "../remote-authenticated = 'true'" {
+ description
+ "Only valid when incoming BFD control packets are
+ authenticated.";
+ }
+ if-feature authentication;
+ type iana-bfd-types:auth-type;
+ description
+ "Authentication type of incoming BFD control packets.";
+ }
+ leaf detection-mode {
+ type enumeration {
+ enum async-with-echo {
+ value "1";
+ description "Async with echo.";
+ }
+ enum async-without-echo {
+ value "2";
+ description "Async without echo.";
+ }
+ enum demand-with-echo {
+ value "3";
+ description "Demand with echo.";
+ }
+ enum demand-without-echo {
+ value "4";
+ description "Demand without echo.";
+ }
+ }
+ description "Detection mode.";
+ }
+ leaf negotiated-tx-interval {
+ type uint32;
+ units microseconds;
+ description "Negotiated transmit interval.";
+ }
+ leaf negotiated-rx-interval {
+ type uint32;
+ units microseconds;
+ description "Negotiated receive interval.";
+ }
+ leaf detection-time {
+ type uint32;
+
+ units microseconds;
+ description "Detection time.";
+ }
+ leaf echo-tx-interval-in-use {
+ when "../../path-type = 'bfd-types:path-ip-sh'" {
+ description
+ "Echo is supported for IP single-hop only.";
+ }
+ if-feature echo-mode;
+ type uint32;
+ units microseconds;
+ description "Echo transmit interval in use.";
+ }
+ }
+
+ container session-statistics {
+ config "false";
+ description "BFD per-session statistics.";
+
+ leaf create-time {
+ type yang:date-and-time;
+ description
+ "Time and date when this session was created.";
+ }
+ leaf last-down-time {
+ type yang:date-and-time;
+ description
+ "Time and date of last time this session went down.";
+ }
+ leaf last-up-time {
+ type yang:date-and-time;
+ description
+ "Time and date of last time this session went up.";
+ }
+ leaf down-count {
+ type yang:counter32;
+ description
+ "The number of times this session has transitioned in the
+ down state.";
+ }
+ leaf admin-down-count {
+ type yang:counter32;
+ description
+ "The number of times this session has transitioned in the
+ admin-down state.";
+ }
+ leaf receive-packet-count {
+ type yang:counter64;
+
+ description
+ "Count of received packets in this session. This includes
+ valid and invalid received packets.";
+ }
+ leaf send-packet-count {
+ type yang:counter64;
+ description "Count of sent packets in this session.";
+ }
+ leaf receive-invalid-packet-count {
+ type yang:counter64;
+ description
+ "Count of invalid received packets in this session.";
+ }
+ leaf send-failed-packet-count {
+ type yang:counter64;
+ description
+ "Count of packets which failed to be sent in this session.";
+ }
+ }
+ }
+
+ grouping session-statistics-summary {
+ description "Grouping for session statistics summary.";
+ container summary {
+ config false;
+ description "BFD session statistics summary.";
+ leaf number-of-sessions {
+ type yang:gauge32;
+ description "Number of BFD sessions.";
+ }
+ leaf number-of-sessions-up {
+ type yang:gauge32;
+ description
+ "Number of BFD sessions currently in up state (as defined
+ in RFC 5880).";
+ }
+ leaf number-of-sessions-down {
+ type yang:gauge32;
+ description
+ "Number of BFD sessions currently in down or init state
+ but not admin-down (as defined in RFC 5880).";
+ }
+ leaf number-of-sessions-admin-down {
+ type yang:gauge32;
+ description
+ "Number of BFD sessions currently in admin-down state (as
+ defined in RFC 5880).";
+ }
+
+ }
+ }
+
+ grouping notification-parms {
+ description
+ "This group describes common parameters that will be sent " +
+ "as part of BFD notification.";
+
+ leaf local-discr {
+ type discriminator;
+ description "BFD local discriminator.";
+ }
+
+ leaf remote-discr {
+ type discriminator;
+ description "BFD remote discriminator.";
+ }
+
+ leaf new-state {
+ type state;
+ description "Current BFD state.";
+ }
+
+ leaf state-change-reason {
+ type iana-bfd-types:diagnostic;
+ description "BFD state change reason.";
+ }
+
+ leaf time-of-last-state-change {
+ type yang:date-and-time;
+ description
+ "Calendar time of previous state change.";
+ }
+
+ leaf dest-addr {
+ type inet:ip-address;
+ description "BFD peer address.";
+ }
+
+ leaf source-addr {
+ type inet:ip-address;
+ description "BFD local address.";
+ }
+
+ leaf session-index {
+ type uint32;
+ description "An index used to uniquely identify BFD sessions.";
+ }
+
+ leaf path-type {
+ type identityref {
+ base path-type;
+ }
+ description "BFD path type.";
+ }
+ }
+}
+
--- /dev/null
+submodule ietf-bgp-common-multiprotocol {
+ yang-version "1.1";
+ belongs-to ietf-bgp {
+ prefix "bgp";
+ }
+
+ import ietf-bgp-types {
+ prefix bt;
+ }
+ import ietf-routing-policy {
+ prefix rpol;
+ }
+
+ include ietf-bgp-common;
+
+ // meta
+ organization
+ "IETF IDR Working Group";
+
+ contact
+ "WG Web: <http://tools.ietf.org/wg/idr>
+ WG List: <idr@ietf.org>
+
+ Authors: Mahesh Jethanandani (mjethanandani at gmail.com),
+ Keyur Patel (keyur at arrcus.com),
+
+ Susan Hares (shares at ndzh.com)";
+
+ description
+ "This sub-module contains groupings that are related to support
+ for multiple protocols in BGP. The groupings are common across
+ multiple contexts.";
+
+ revision "2019-06-13" {
+ description
+ "Initial Version";
+ reference
+ "RFC XXX, BGP Model for Service Provider Network.";
+ }
+
+ grouping mp-afi-safi-graceful-restart-config {
+ description
+ "BGP graceful restart parameters that apply on a per-AFI-SAFI
+ basis";
+
+ leaf enabled {
+ type boolean;
+ default false;
+ description
+ "This leaf indicates whether graceful-restart is enabled for
+ this AFI-SAFI";
+ }
+ }
+
+ grouping mp-afi-safi-config {
+ description
+ "Configuration parameters used for all BGP AFI-SAFIs";
+
+ leaf afi-safi-name {
+ type identityref {
+ base "bt:afi-safi-type";
+ }
+ description "AFI,SAFI";
+ }
+
+ leaf enabled {
+ type boolean;
+ default false;
+ description
+ "This leaf indicates whether the IPv4 Unicast AFI,SAFI is
+ enabled for the neighbour or group";
+ }
+ }
+
+ grouping mp-all-afi-safi-list-contents {
+ description
+ "A common grouping used for contents of the list that is used
+ for AFI-SAFI entries";
+
+ // import and export policy included for the afi/safi
+ uses rpol:apply-policy-group;
+
+ container ipv4-unicast {
+ when "../afi-safi-name = 'bt:ipv4-unicast'" {
+ description
+ "Include this container for IPv4 Unicast specific
+ configuration";
+ }
+
+ description
+ "IPv4 unicast configuration options";
+
+ // include common IPv[46] unicast options
+ uses mp-ipv4-ipv6-unicast-common;
+
+ // placeholder for IPv4 unicast specific configuration
+ }
+
+ container ipv6-unicast {
+ when "../afi-safi-name = 'bt:ipv6-unicast'" {
+ description
+ "Include this container for IPv6 Unicast specific
+ configuration";
+ }
+
+ description
+ "IPv6 unicast configuration options";
+
+ // include common IPv[46] unicast options
+ uses mp-ipv4-ipv6-unicast-common;
+
+ // placeholder for IPv6 unicast specific configuration
+ // options
+ }
+
+ container ipv4-labeled-unicast {
+ when "../afi-safi-name = 'bt:ipv4-labeled-unicast'" {
+ description
+ "Include this container for IPv4 Labeled Unicast specific
+ configuration";
+ }
+
+ description
+ "IPv4 Labeled Unicast configuration options";
+
+ uses mp-all-afi-safi-common;
+
+ // placeholder for IPv4 Labeled Unicast specific config
+ // options
+ }
+
+ container ipv6-labeled-unicast {
+ when "../afi-safi-name = 'bt:ipv6-labeled-unicast'" {
+ description
+ "Include this container for IPv6 Labeled Unicast specific
+ configuration";
+ }
+
+ description
+ "IPv6 Labeled Unicast configuration options";
+
+ uses mp-all-afi-safi-common;
+
+ // placeholder for IPv6 Labeled Unicast specific config
+ // options.
+ }
+
+ container l3vpn-ipv4-unicast {
+ when "../afi-safi-name = 'bt:l3vpn-ipv4-unicast'" {
+ description
+ "Include this container for IPv4 Unicast L3VPN specific
+ configuration";
+ }
+
+ description
+ "Unicast IPv4 L3VPN configuration options";
+
+ // include common L3VPN configuration options
+ uses mp-l3vpn-ipv4-ipv6-unicast-common;
+
+ // placeholder for IPv4 Unicast L3VPN specific config options.
+ }
+
+ container l3vpn-ipv6-unicast {
+ when "../afi-safi-name = 'bt:l3vpn-ipv6-unicast'" {
+ description
+ "Include this container for unicast IPv6 L3VPN specific
+ configuration";
+ }
+
+ description
+ "Unicast IPv6 L3VPN configuration options";
+
+ // include common L3VPN configuration options
+ uses mp-l3vpn-ipv4-ipv6-unicast-common;
+
+ // placeholder for IPv6 Unicast L3VPN specific configuration
+ // options
+ }
+
+ container l3vpn-ipv4-multicast {
+ when "../afi-safi-name = 'bt:l3vpn-ipv4-multicast'" {
+ description
+ "Include this container for multicast IPv6 L3VPN specific
+ configuration";
+ }
+
+ description
+ "Multicast IPv4 L3VPN configuration options";
+
+ // include common L3VPN multicast options
+ uses mp-l3vpn-ipv4-ipv6-multicast-common;
+
+ // placeholder for IPv4 Multicast L3VPN specific configuration
+ // options
+ }
+
+ container l3vpn-ipv6-multicast {
+ when "../afi-safi-name = 'bt:l3vpn-ipv6-multicast'" {
+ description
+ "Include this container for multicast IPv6 L3VPN specific
+ configuration";
+ }
+ description
+ "Multicast IPv6 L3VPN configuration options";
+
+ // include common L3VPN multicast options
+ uses mp-l3vpn-ipv4-ipv6-multicast-common;
+
+ // placeholder for IPv6 Multicast L3VPN specific configuration
+ // options
+ }
+
+ container l2vpn-vpls {
+ when "../afi-safi-name = 'bt:l2vpn-vpls'" {
+ description
+ "Include this container for BGP-signalled VPLS specific
+ configuration";
+
+ }
+
+ description
+ "BGP-signalled VPLS configuration options";
+
+ // include common L2VPN options
+ uses mp-l2vpn-common;
+
+ // placeholder for BGP-signalled VPLS specific configuration
+ // options
+ }
+
+ container l2vpn-evpn {
+ when "../afi-safi-name = 'bt:l2vpn-evpn'" {
+ description
+ "Include this container for BGP EVPN specific
+ configuration";
+ }
+
+ description
+ "BGP EVPN configuration options";
+
+ // include common L2VPN options
+ uses mp-l2vpn-common;
+
+ // placeholder for BGP EVPN specific configuration options
+ }
+ }
+
+ // Common groupings across multiple AFI,SAFIs
+ grouping mp-all-afi-safi-common {
+ description
+ "Grouping for configuration common to all AFI,SAFI";
+
+ container prefix-limit {
+ description
+ "Parameters relating to the prefix limit for the AFI-SAFI";
+ leaf max-prefixes {
+ type uint32;
+ description
+ "Maximum number of prefixes that will be accepted from the
+ neighbour";
+ }
+ leaf shutdown-threshold-pct {
+ type bt:percentage;
+ description
+ "Threshold on number of prefixes that can be received from
+ a neighbour before generation of warning messages or log
+
+ entries. Expressed as a percentage of max-prefixes";
+ }
+
+ leaf restart-timer {
+ type decimal64 {
+ fraction-digits 2;
+ }
+ units "seconds";
+ description
+ "Time interval in seconds after which the BGP session is
+ re-established after being torn down due to exceeding the
+ max-prefix limit.";
+ }
+ }
+ }
+
+ grouping mp-ipv4-ipv6-unicast-common {
+ description
+ "Common configuration that is applicable for IPv4 and IPv6
+ unicast";
+
+ // include common afi-safi options.
+ uses mp-all-afi-safi-common;
+
+ // configuration options that are specific to IPv[46] unicast
+ leaf send-default-route {
+ type boolean;
+ default "false";
+ description
+ "If set to true, send the default-route to the neighbour(s)";
+ }
+ }
+
+ grouping mp-l3vpn-ipv4-ipv6-unicast-common {
+ description
+ "Common configuration applied across L3VPN for IPv4
+ and IPv6";
+
+ // placeholder -- specific configuration options that are generic
+ // across IPv[46] unicast address families.
+ uses mp-all-afi-safi-common;
+ }
+
+ grouping mp-l3vpn-ipv4-ipv6-multicast-common {
+ description
+ "Common configuration applied across L3VPN for IPv4
+ and IPv6";
+
+ // placeholder -- specific configuration options that are
+ // generic across IPv[46] multicast address families.
+ uses mp-all-afi-safi-common;
+ }
+
+ grouping mp-l2vpn-common {
+ description
+ "Common configuration applied across L2VPN address
+ families";
+
+ // placeholder -- specific configuration options that are
+ // generic across L2VPN address families
+ uses mp-all-afi-safi-common;
+ }
+
+ // Config groupings for common groups
+ grouping mp-all-afi-safi-common-prefix-limit-config {
+ description
+ "Configuration parameters relating to prefix-limits for an
+ AFI-SAFI";
+
+ }
+}
--- /dev/null
+submodule ietf-bgp-common-structure {
+ yang-version "1.1";
+ belongs-to ietf-bgp {
+ prefix "bgp";
+ }
+
+ import ietf-bgp-types { prefix bt; }
+ import ietf-routing-policy { prefix rpol; }
+ include ietf-bgp-common-multiprotocol;
+ include ietf-bgp-common;
+
+ // meta
+ organization
+ "IETF IDR Working Group";
+
+ contact
+ "WG Web: <http://tools.ietf.org/wg/idr>
+ WG List: <idr@ietf.org>
+
+ Authors: Mahesh Jethanandani (mjethanandani at gmail.com),
+ Keyur Patel (keyur at arrcus.com),
+
+ Susan Hares (shares at ndzh.com)";
+
+ description
+ "This sub-module contains groupings that are common across
+ multiple BGP contexts and provide structure around other
+ primitive groupings.";
+
+
+ revision "2019-06-13" {
+ description
+ "Initial Version";
+ reference
+ "RFC XXX, BGP Model for Service Provider Network.";
+ }
+
+ grouping structure-neighbor-group-ebgp-multihop {
+ description
+ "Structural grouping used to include eBGP multi-hop
+ configuration and state for both BGP neighbors and peer
+ groups";
+
+ container ebgp-multihop {
+ description
+ "eBGP multi-hop parameters for the BGPgroup";
+
+ leaf enabled {
+ type boolean;
+ default "false";
+ description
+ "When enabled the referenced group or neighbors are
+ permitted to be indirectly connected - including cases
+ where the TTL can be decremented between the BGP peers";
+ }
+
+ leaf multihop-ttl {
+ type uint8;
+ description
+ "Time-to-live value to use when packets are sent to the
+ referenced group or neighbors and ebgp-multihop is
+ enabled";
+ }
+ }
+ }
+
+ grouping structure-neighbor-group-route-reflector {
+ description
+ "Structural grouping used to include route reflector
+ configuration and state for both BGP neighbors and peer
+
+ groups";
+
+ container route-reflector {
+ description
+ "Route reflector parameters for the BGPgroup";
+ reference
+ "RFC 4456: BGP Route Reflection.";
+
+ leaf route-reflector-cluster-id {
+ type bt:rr-cluster-id-type;
+ description
+ "route-reflector cluster id to use when local router is
+ configured as a route reflector. Commonly set at the
+ group level, but allows a different cluster id to be set
+ for each neighbor.";
+ }
+
+ leaf route-reflector-client {
+ type boolean;
+ default "false";
+ description
+ "Configure the neighbor as a route reflector client.";
+ }
+ }
+ }
+
+ grouping structure-neighbor-group-as-path-options {
+ description
+ "Structural grouping used to include AS_PATH manipulation
+ configuration and state for both BGP neighbors and peer
+ groups";
+
+ container as-path-options {
+ description
+ "AS_PATH manipulation parameters for the BGP neighbor or
+ group";
+ leaf allow-own-as {
+ type uint8;
+ default 0;
+ description
+ "Specify the number of occurrences of the local BGP
+ speaker's AS that can occur within the AS_PATH before it
+ is rejected.";
+ }
+
+ leaf replace-peer-as {
+ type boolean;
+ default "false";
+
+ description
+ "Replace occurrences of the peer's AS in the AS_PATH with
+ the local autonomous system number";
+ }
+ }
+ }
+
+ grouping structure-neighbor-group-add-paths {
+ description
+ "Structural grouping used to include ADD-PATHs configuration
+ and state for both BGP neighbors and peer groups";
+
+ container add-paths {
+ description
+ "Parameters relating to the advertisement and receipt of
+ multiple paths for a single NLRI (add-paths)";
+
+ leaf receive {
+ type boolean;
+ default false;
+ description
+ "Enable ability to receive multiple path advertisements for
+ an NLRI from the neighbor or group";
+ }
+
+ leaf send-max {
+ type uint8;
+ description
+ "The maximum number of paths to advertise to neighbors for
+ a single NLRI";
+ }
+ leaf eligible-prefix-policy {
+ type leafref {
+ path "/rpol:routing-policy/rpol:policy-definitions/" +
+ "rpol:policy-definition/rpol:name";
+ }
+ description
+ "A reference to a routing policy which can be used to
+ restrict the prefixes for which add-paths is enabled";
+ }
+ }
+ }
+}
--- /dev/null
+submodule ietf-bgp-common {
+ yang-version "1.1";
+ belongs-to ietf-bgp {
+ prefix "bgp";
+ }
+
+ import ietf-bgp-types {
+ prefix bt;
+ }
+ import ietf-inet-types {
+ prefix inet;
+ }
+
+ organization
+ "IETF IDR Working Group";
+
+ contact
+ "WG Web: <http://tools.ietf.org/wg/idr>
+ WG List: <idr@ietf.org>
+
+ Authors: Mahesh Jethanandani (mjethanandani at gmail.com),
+ Keyur Patel (keyur at arrcus.com),
+ Susan Hares (shares at ndzh.com";
+
+ description
+ "This sub-module contains common groupings that are common across
+ multiple contexts within the BGP module. That is to say that
+ they may be application to a subset of global, peer-group or
+ neighbor contexts.";
+
+ revision "2019-06-13" {
+ description
+ "Initial Version";
+ reference
+ "RFC XXXX, BGP Model for Service Provider Network.";
+ }
+
+ grouping neighbor-group-timers-config {
+ description
+ "Config parameters related to timers associated with the BGP
+ peer";
+
+ leaf connect-retry-interval {
+ type uint32 {
+ range "1..65535";
+ }
+ units "seconds";
+
+ description
+ "Time interval (in seconds) for the
+ ConnectRetryTimer. The suggested value
+ for this timer is 120 seconds.";
+ reference
+ "RFC 4271, Section 8.2.2. This is the value used
+ to initialize the 'ConnectRetryTimer'.";
+ }
+
+ leaf hold-time {
+ type uint32 {
+ range "0 | 3..65535";
+ }
+ units "seconds";
+ description
+ "Time interval (in seconds) for the HoldTimer
+ established with the peer. The
+ value of this object is calculated by this
+ BGP speaker, using the smaller of the
+ values in hold-time-configured and the
+ Hold Time received in the OPEN message.
+
+ This value must be at least three seconds
+ if it is not zero (0).
+
+ If the Hold Timer has not been established
+ with the peer this object MUST have a value
+ of zero (0).
+
+ If the hold-time-configured object has
+ a value of (0), then this object MUST have a
+ value of (0).";
+ reference
+ "RFC 4271, Section 4.2.";
+ }
+
+ leaf keepalive-interval {
+ type uint32 {
+ range "0..21845";
+ }
+ units "seconds";
+ default 30;
+ description
+ "Time interval (in seconds) for the KeepAlive
+ timer established with the peer. The value
+ of this object is calculated by this BGP
+ speaker such that, when compared with
+ hold-time, it has the same proportion
+
+ that keep-alive-configured has,
+ compared with hold-time-configured.
+
+ If the KeepAlive timer has not been established
+ with the peer, this object MUST have a value
+ of zero (0).
+
+ If the of keep-alive-configured object
+ has a value of (0), then this object MUST have
+ a value of (0).";
+ reference
+ "RFC 4271, Section 4.4.";
+ }
+
+ leaf hold-time-configured {
+ type uint32 {
+ range "0 | 3..65535";
+ }
+ units "seconds";
+ description
+ "Time interval (in seconds) for the Hold Time
+ configured for this BGP speaker with this
+ peer. This value is placed in an OPEN
+ message sent to this peer by this BGP
+ speaker, and is compared with the Hold
+ Time field in an OPEN message received
+ from the peer when determining the Hold
+ Time (hold-time) with the peer.
+ This value must not be less than three
+ seconds if it is not zero (0). If it is
+ zero (0), the Hold Time is NOT to be
+ established with the peer. The suggested
+ value for this timer is 90 seconds.";
+ reference
+ "RFC 4271, Section 4.2.
+ RFC 4271, Section 10.";
+ }
+
+ leaf keep-alive-configured {
+ type uint32 {
+ range "0..21845";
+ }
+ units "seconds";
+ description
+ "Time interval (in seconds) for the
+ KeepAlive timer configured for this BGP
+ speaker with this peer. The value of this
+ object will only determine the
+
+ KEEPALIVE messages' frequency relative to
+ the value specified in
+ hold-time-configured; the actual
+ time interval for the KEEPALIVE messages is
+ indicated by keep-alive. A
+ reasonable maximum value for this timer
+ would be one third of that of
+ hold-time-configured.
+ If the value of this object is zero (0),
+ no periodical KEEPALIVE messages are sent
+ to the peer after the BGP connection has
+ been established. The suggested value for
+ this timer is 30 seconds.";
+ reference
+ "RFC 4271, Section 4.4.
+ RFC 4271, Section 10.";
+ }
+
+ leaf min-as-origination-interval {
+ type uint32 {
+ range "0..65535";
+ }
+ units "seconds";
+ description
+ "Time interval (in seconds) for the
+ MinASOriginationInterval timer.
+ The suggested value for this timer is 15
+ seconds.";
+ reference
+ "RFC 4271, Section 9.2.1.2.
+ RFC 4271, Section 10.";
+ }
+
+ leaf min-route-advertisement-interval {
+ type uint32 {
+ range "0..65535";
+ }
+ units "seconds";
+ description
+ "Time interval (in seconds) for the
+ MinRouteAdvertisementInterval timer.
+ The suggested value for this timer is 30
+ seconds for EBGP connections and 5
+ seconds for IBGP connections.";
+ reference
+ "RFC 4271, Section 9.2.1.1.
+ RFC 4271, Section 10.";
+ }
+
+ }
+
+ grouping neighbor-group-config {
+ description
+ "Neighbor level configuration items.";
+
+ leaf peer-as {
+ type inet:as-number;
+ description
+ "AS number of the peer.";
+ }
+
+ leaf local-as {
+ type inet:as-number;
+ description
+ "The local autonomous system number that is to be used when
+ establishing sessions with the remote peer or peer group, if
+ this differs from the global BGP router autonomous system
+ number.";
+ }
+
+ leaf peer-type {
+ type bt:peer-type;
+ description
+ "Explicitly designate the peer or peer group as internal
+ (iBGP) or external (eBGP).";
+ }
+
+ leaf auth-password {
+ type string;
+ description
+ "Configures an MD5 authentication password for use with
+ neighboring devices.";
+ }
+
+ leaf remove-private-as {
+ // could also make this a container with a flag to enable
+ // remove-private and separate option. here, option implies
+ // remove-private is enabled.
+ type bt:remove-private-as-option;
+ description
+ "Remove private AS numbers from updates sent to peers - when
+ this leaf is not specified, the AS_PATH attribute should be
+ sent to the peer unchanged";
+ }
+
+ leaf description {
+ type string;
+
+ description
+ "An optional textual description (intended primarily for use
+ with a peer or group";
+ }
+ }
+
+ grouping neighbor-group-transport-config {
+ description
+ "Configuration parameters relating to the transport protocol
+ used by the BGP session to the peer";
+
+ leaf tcp-mss {
+ type uint16;
+ description
+ "Sets the max segment size for BGP TCP sessions.";
+ }
+
+ leaf mtu-discovery {
+ type boolean;
+ default false;
+ description
+ "Turns path mtu discovery for BGP TCP sessions on (true) or
+ off (false)";
+ }
+
+ leaf passive-mode {
+ type boolean;
+ default false;
+ description
+ "Wait for peers to issue requests to open a BGP session,
+ rather than initiating sessions from the local router.";
+ }
+
+ leaf local-address {
+ /* type union {
+ type inet:ip-address; */
+ type leafref {
+ path "../../../../interfaces/interface/name";
+ }
+ /* } */
+ description
+ "Set the local IP (either IPv4 or IPv6) address to use for
+ the session when sending BGP update messages. This may be
+ expressed as either an IP address or reference to the name
+ of an interface.";
+ }
+ }
+
+ grouping graceful-restart-config {
+ description
+ "Configuration parameters relating to BGP graceful restart.";
+
+ leaf enabled {
+ type boolean;
+ description
+ "Enable or disable the graceful-restart capability.";
+ }
+
+ leaf restart-time {
+ type uint16 {
+ range 0..4096;
+ }
+ description
+ "Estimated time (in seconds) for the local BGP speaker to
+ restart a session. This value is advertise in the graceful
+ restart BGP capability. This is a 12-bit value, referred to
+ as Restart Time in RFC4724. Per RFC4724, the suggested
+ default value is <= the hold-time value.";
+ }
+
+ leaf stale-routes-time {
+ type uint32;
+ description
+ "An upper-bound on the time that stale routes will be
+ retained by a router after a session is restarted. If an
+ End-of-RIB (EOR) marker is received prior to this timer
+ expiring stale-routes will be flushed upon its receipt - if
+ no EOR is received, then when this timer expires stale paths
+ will be purged. This timer is referred to as the
+ Selection_Deferral_Timer in RFC4724";
+ }
+
+ leaf helper-only {
+ type boolean;
+ default true;
+ description
+ "Enable graceful-restart in helper mode only. When this leaf
+ is set, the local system does not retain forwarding its own
+ state during a restart, but supports procedures for the
+ receiving speaker, as defined in RFC4724.";
+ }
+ }
+
+ grouping use-multiple-paths-config {
+ description
+ "Generic configuration options relating to use of multiple
+
+ paths for a referenced AFI-SAFI, group or neighbor";
+
+ leaf enabled {
+ type boolean;
+ default false;
+ description
+ "Whether the use of multiple paths for the same NLRI is
+ enabled for the neighbor. This value is overridden by any
+ more specific configuration value.";
+ }
+ }
+
+ grouping use-multiple-paths-ebgp-as-options-config {
+ description
+ "Configuration parameters specific to eBGP multi-path applicable
+ to all contexts";
+
+ leaf allow-multiple-as {
+ type boolean;
+ default "false";
+ description
+ "Allow multi-path to use paths from different neighboring ASes.
+ The default is to only consider multiple paths from the same
+ neighboring AS.";
+ }
+ }
+
+ grouping global-group-use-multiple-paths {
+ description
+ "Common grouping used for both global and groups which provides
+ configuration and state parameters relating to use of multiple
+ paths";
+
+ container use-multiple-paths {
+ description
+ "Parameters related to the use of multiple paths for the
+ same NLRI";
+
+ uses use-multiple-paths-config;
+
+ container ebgp {
+ description
+ "Multi-Path parameters for eBGP";
+
+ leaf allow-multiple-as {
+ type boolean;
+ default "false";
+ description
+
+ "Allow multi-path to use paths from different neighboring
+ ASes. The default is to only consider multiple paths
+ from the same neighboring AS.";
+ }
+
+ leaf maximum-paths {
+ type uint32;
+ default 1;
+ description
+ "Maximum number of parallel paths to consider when using
+ BGP multi-path. The default is use a single path.";
+ }
+ }
+
+ container ibgp {
+ description
+ "Multi-Path parameters for iBGP";
+
+ leaf maximum-paths {
+ type uint32;
+ default 1;
+ description
+ "Maximum number of parallel paths to consider when using
+ iBGP multi-path. The default is to use a single path";
+ }
+ }
+ }
+ }
+
+ grouping route-selection-options {
+ description
+ "Configuration and state relating to route selection options";
+
+ container route-selection-options {
+ description
+ "Parameters relating to options for route selection";
+
+ leaf enable-aigp {
+ type boolean;
+ default false;
+ description
+ "Flag to enable sending / receiving accumulated IGP
+ attribute in routing updates";
+ }
+ }
+ }
+
+ grouping state {
+
+ description
+ "Grouping containing common counters relating to prefixes and
+ paths";
+
+ leaf total-paths {
+ type uint32;
+ config false;
+ description
+ "Total number of BGP paths within the context";
+ }
+
+ leaf total-prefixes {
+ type uint32;
+ config false;
+ description
+ "Total number of BGP prefixes received within the context";
+ }
+ }
+}
--- /dev/null
+submodule ietf-bgp-neighbor {
+ yang-version "1.1";
+ belongs-to ietf-bgp {
+ prefix "bgp";
+ }
+
+ // Include the common submodule
+ include ietf-bgp-common;
+ include ietf-bgp-common-multiprotocol;
+ include ietf-bgp-peer-group;
+ include ietf-bgp-common-structure;
+
+ // meta
+ organization
+ "IETF IDR Working Group";
+
+ contact
+ "WG Web: <http://tools.ietf.org/wg/idr>
+ WG List: <idr@ietf.org>
+
+ Authors: Mahesh Jethanandani (mjethanandani at gmail.com),
+ Keyur Patel (keyur at arrcus.com),
+ Susan Hares (shares at ndzh.com)";
+
+ description
+ "This sub-module contains groupings that are specific to the
+ neighbor context of the BGP module.";
+
+ revision "2019-06-13" {
+ description
+ "Initial Version";
+ reference
+ "RFC XXX, BGP Model for Service Provider Network.";
+ }
+
+ grouping bgp-neighbor-use-multiple-paths {
+ description
+ "Multi-path configuration and state applicable to a BGP
+ neighbor";
+
+ container use-multiple-paths {
+ description
+ "Parameters related to the use of multiple-paths for the same
+ NLRI when they are received only from this neighbor";
+
+ uses use-multiple-paths-config;
+
+ container ebgp {
+ description
+ "Multi-path configuration for eBGP";
+ uses use-multiple-paths-ebgp-as-options-config;
+ }
+ }
+ }
+
+ grouping bgp-neighbor-counters-message-types-state {
+ description
+ "Grouping of BGP message types, included for re-use across
+ counters";
+
+ leaf updates-received {
+ type uint64;
+ description
+ "Number of BGP UPDATE messages received from this neighbor.";
+ reference
+ "RFC 4273: bgpPeerInUpdates.";
+ }
+
+ leaf updates-sent {
+ type uint64;
+ description
+ "Number of BGP UPDATE messages sent to this neighbor";
+ reference
+ "RFC 4273 - bgpPeerOutUpdates";
+ }
+
+ leaf messages-received {
+ type uint64;
+ description
+ "Number of BGP messages received from thsi neighbor";
+ reference
+ "RFC 4273 - bgpPeerInTotalMessages";
+ }
+
+ leaf messages-sent {
+ type uint64;
+ description
+ "Number of BGP messages received from thsi neighbor";
+ reference
+ "RFC 4273 - bgpPeerOutTotalMessages";
+ }
+
+ leaf notification {
+ type uint64;
+ description
+ "Number of BGP NOTIFICATION messages indicating an error
+ condition has occurred exchanged.";
+ }
+ }
+
+ grouping bgp-neighbor-afi-safi-list {
+ description
+ "List of address-families associated with the BGP neighbor";
+
+ list afi-safi {
+ key "afi-safi-name";
+
+ description
+ "AFI, SAFI configuration available for the neighbor or
+ group";
+
+ uses mp-afi-safi-config;
+
+ leaf active {
+ type boolean;
+ config false;
+ description
+ "This value indicates whether a particular AFI-SAFI has
+ been successfully negotiated with the peer. An AFI-SAFI may
+ be enabled in the current running configuration, but a
+ session restart may be required in order to negotiate the
+ new capability.";
+ }
+
+ container prefixes {
+ config false;
+ description
+ "Prefix counters for the BGP session";
+
+ leaf received {
+ type uint32;
+ description
+ "The number of prefixes received from the neighbor";
+ }
+
+ leaf sent {
+ type uint32;
+ description
+ "The number of prefixes advertised to the neighbor";
+ }
+
+ leaf installed {
+ type uint32;
+ description
+ "The number of advertised prefixes installed in the
+ Loc-RIB";
+ }
+ }
+
+ container graceful-restart {
+ description
+ "Parameters relating to BGP graceful-restart";
+
+ uses mp-afi-safi-graceful-restart-config;
+
+ leaf received {
+ type boolean;
+ config false;
+ description
+ "This leaf indicates whether the neighbor advertised the
+ ability to support graceful-restart for this AFI-SAFI";
+ }
+
+ leaf advertised {
+ type boolean;
+ config false;
+ description
+ "This leaf indicates whether the ability to support
+ graceful-restart has been advertised to the peer";
+ }
+ }
+
+ uses mp-all-afi-safi-list-contents;
+ uses bgp-neighbor-use-multiple-paths;
+ }
+ }
+}
--- /dev/null
+submodule ietf-bgp-peer-group {
+
+ yang-version "1.1";
+ belongs-to ietf-bgp {
+ prefix "bgp";
+ }
+
+ import ietf-routing-policy {
+ prefix rpol;
+ }
+
+ // Include the common submodule
+ include ietf-bgp-common;
+ include ietf-bgp-common-multiprotocol;
+ include ietf-bgp-common-structure;
+
+ // meta
+ organization
+ "IETF IDR Working Group";
+
+ contact
+ "WG Web: <http://tools.ietf.org/wg/idr>
+ WG List: <idr@ietf.org>
+
+ Authors: Mahesh Jethanandani (mjethanandani at gmail.com),
+ Keyur Patel (keyur at arrcus.com),
+ Susan Hares (shares at ndzh.com)";
+
+ description
+ "This sub-module contains groupings that are specific to the
+ peer-group context of the OpenConfig BGP module.";
+
+ revision "2019-06-13" {
+ description
+ "Initial Version";
+ reference
+ "RFC XXX, BGP Model for Service Provider Network.";
+ }
+
+ grouping bgp-peer-group-config {
+ description
+ "Configuration parameters relating to a base BGP peer group
+ that are not also applicable to any other context (e.g.,
+ neighbor)";
+
+ leaf peer-group-name {
+ type string;
+ description
+ "Name of the BGP peer-group";
+ }
+
+ }
+
+ grouping bgp-peer-group-afi-safi-list {
+ description
+ "List of address-families associated with the BGP peer-group";
+
+ list afi-safi {
+ key "afi-safi-name";
+
+ description
+ "AFI, SAFI configuration available for the
+ neighbour or group";
+
+ uses mp-afi-safi-config;
+
+ container graceful-restart {
+ description
+ "Parameters relating to BGP graceful-restart";
+
+ uses mp-afi-safi-graceful-restart-config;
+ }
+
+ uses route-selection-options;
+ uses global-group-use-multiple-paths;
+ uses mp-all-afi-safi-list-contents;
+ }
+ }
+
+ grouping bgp-peer-group-base {
+ description
+ "Parameters related to a BGP group.";
+
+ uses bgp-peer-group-config;
+ uses neighbor-group-config;
+ uses state;
+
+ container timers {
+ description
+ "Timers related to a BGP peer-group.";
+
+ uses neighbor-group-timers-config;
+ }
+
+ container transport {
+ description
+ "Transport session parameters for the BGP peer-group.";
+
+ uses neighbor-group-transport-config;
+
+ }
+
+ container graceful-restart {
+ description
+ "Parameters relating the graceful restart mechanism for BGP.";
+
+ uses graceful-restart-config;
+ }
+
+ uses structure-neighbor-group-ebgp-multihop;
+ uses structure-neighbor-group-route-reflector;
+ uses structure-neighbor-group-as-path-options;
+ uses structure-neighbor-group-add-paths;
+ uses global-group-use-multiple-paths;
+ uses rpol:apply-policy-group;
+
+ container afi-safis {
+ description
+ "Per-address-family configuration parameters associated with
+ the group.";
+ uses bgp-peer-group-afi-safi-list;
+ }
+ }
+
+ grouping bgp-peer-group-list {
+ description
+ "The list of BGP peer groups";
+
+ list peer-group {
+ key "peer-group-name";
+ description
+ "List of BGP peer-groups configured on the local system -
+ uniquely identified by peer-group name";
+
+ uses bgp-peer-group-base;
+ }
+ }
+}
--- /dev/null
+module ietf-bgp-policy {
+ yang-version "1.1";
+ namespace "urn:ietf:params:xml:ns:yang:ietf-bgp-policy";
+ prefix "bp";
+
+ // import some basic types
+ import ietf-inet-types {
+ prefix inet;
+ }
+ import ietf-routing-policy {
+ prefix rpol;
+ }
+ import ietf-bgp-types {
+ prefix bt;
+ }
+
+ import ietf-routing-types {
+ prefix rt-types;
+ }
+
+ organization
+ "IETF IDR Working Group";
+
+ contact
+ "WG Web: <http://tools.ietf.org/wg/idr>
+ WG List: <idr@ietf.org>
+
+ Authors: Mahesh Jethanandani (mjethanandani at gmail.com),
+ Keyur Patel (keyur at arrcus.com),
+ Susan Hares (shares at ndzh.com)";
+
+ description
+ "This module contains data definitions for BGP routing policy.
+ It augments the base routing-policy module with BGP-specific
+ options for conditions and actions.";
+
+ revision "2019-06-13" {
+ description
+ "Initial Version";
+ reference
+ "RFC XXX, BGP Model for Service Provider Network.";
+ }
+
+ // typedef statements
+
+ typedef bgp-set-community-option-type {
+ type enumeration {
+ enum ADD {
+ description
+ "Add the specified communities to the existing
+ community attribute";
+ }
+ enum REMOVE {
+ description
+ "Remove the specified communities from the
+ existing community attribute";
+ }
+ enum REPLACE {
+ description
+ "Replace the existing community attribute with
+ the specified communities. If an empty set is
+ specified, this removes the community attribute
+ from the route.";
+ }
+ }
+ description
+ "Type definition for options when setting the community
+ attribute in a policy action";
+ }
+
+ typedef bgp-next-hop-type {
+ type union {
+ type inet:ip-address-no-zone;
+ type enumeration {
+ enum SELF {
+
+ description
+ "Special designation for local router's own
+ address, i.e., next-hop-self";
+ }
+ }
+ }
+ description
+ "Type definition for specifying next-hop in policy actions";
+ }
+
+ typedef bgp-set-med-type {
+ type union {
+ type uint32;
+ type string {
+ pattern "^[+-][0-9]+";
+ }
+ type enumeration {
+ enum IGP {
+ description
+ "Set the MED value to the IGP cost toward the
+ next hop for the route";
+ }
+ }
+ }
+ description
+ "Type definition for specifying how the BGP MED can
+ be set in BGP policy actions. The three choices are to set
+ the MED directly, increment/decrement using +/- notation,
+ and setting it to the IGP cost (predefined value).";
+ }
+
+ // augment statements
+
+ augment "/rpol:routing-policy/rpol:defined-sets" {
+ description
+ "Adds BGP defined sets container to routing policy model.";
+
+ container bgp-defined-sets {
+ description
+ "BGP-related set definitions for policy match conditions";
+
+ container community-sets {
+ description
+ "Enclosing container for list of defined BGP community sets";
+
+ list community-set {
+ key "community-set-name";
+ description
+
+ "List of defined BGP community sets";
+
+ leaf community-set-name {
+ type string;
+ mandatory true;
+ description
+ "Name / label of the community set -- this is used to
+ reference the set in match conditions";
+ }
+
+ leaf-list community-member {
+ type union {
+ type bt:bgp-std-community-type;
+ type bt:bgp-community-regexp-type;
+ type bt:bgp-well-known-community-type;
+ }
+ description
+ "Members of the community set";
+ }
+ }
+ }
+
+ container ext-community-sets {
+ description
+ "Enclosing container for list of extended BGP community
+ sets";
+ list ext-community-set {
+ key "ext-community-set-name";
+ description
+ "List of defined extended BGP community sets";
+
+ leaf ext-community-set-name {
+ type string;
+ description
+ "Name / label of the extended community set -- this is
+ used to reference the set in match conditions";
+ }
+
+ leaf-list ext-community-member {
+ type union {
+ type rt-types:route-target;
+ type bt:bgp-community-regexp-type;
+ }
+ description
+ "Members of the extended community set";
+ }
+ }
+ }
+
+ container as-path-sets {
+ description
+ "Enclosing container for list of define AS path sets";
+
+ list as-path-set {
+ key "as-path-set-name";
+ description
+ "List of defined AS path sets";
+
+ leaf as-path-set-name {
+ type string;
+ description
+ "Name of the AS path set -- this is used to reference the
+ set in match conditions";
+ }
+
+ leaf-list as-path-set-member {
+ // TODO: need to refine typedef for AS path expressions
+ type string;
+ description
+ "AS path expression -- list of ASes in the set";
+ }
+ }
+ }
+ }
+ }
+
+ grouping set-community-action-common {
+ description
+ "Common leaves for set-community and set-ext-community
+ actions";
+
+ leaf method {
+ type enumeration {
+ enum INLINE {
+ description
+ "The extended communities are specified inline as a
+ list";
+ }
+ enum REFERENCE {
+ description
+ "The extended communities are specified by referencing a
+ defined ext-community set";
+ }
+ }
+ description
+ "Indicates the method used to specify the extended
+ communities for the set-ext-community action";
+
+ }
+
+ leaf options {
+ type bgp-set-community-option-type;
+ description
+ "Options for modifying the community attribute with
+ the specified values. These options apply to both
+ methods of setting the community attribute.";
+ }
+ }
+
+ augment "/rpol:routing-policy/rpol:policy-definitions/" +
+ "rpol:policy-definition/rpol:statements/rpol:statement/" +
+ "rpol:conditions" {
+ description
+ "BGP policy conditions added to routing policy module";
+
+ container bgp-conditions {
+ description
+ "Top-level container for BGP specific policy conditions ";
+
+ leaf med-eq {
+ type uint32;
+ description
+ "Condition to check if the received MED value is equal to
+ the specified value";
+ }
+
+ leaf origin-eq {
+ type bt:bgp-origin-attr-type;
+ description
+ "Condition to check if the route origin is equal to the
+ specified value";
+ }
+
+ leaf-list next-hop-in {
+ type inet:ip-address-no-zone;
+ description
+ "List of next hop addresses to check for in the route
+ update";
+ }
+
+ leaf-list afi-safi-in {
+ type identityref {
+ base bt:afi-safi-type;
+ }
+ description
+ "List of address families which the NLRI may be within";
+
+ }
+
+ leaf local-pref-eq {
+ type uint32;
+ // TODO: add support for other comparisons if needed
+ description
+ "Condition to check if the local pref attribute is equal to
+ the specified value";
+ }
+
+ leaf route-type {
+ // TODO: verify extent of vendor support for this comparison
+ type enumeration {
+ enum INTERNAL {
+ description "route type is internal";
+ }
+ enum EXTERNAL {
+ description "route type is external";
+ }
+ }
+ description
+ "Condition to check the route type in the route update";
+ }
+
+ container community-count {
+ description
+ "Value and comparison operations for conditions based on the
+ number of communities in the route update";
+ }
+
+ container as-path-length {
+ description
+ "Value and comparison operations for conditions based on the
+ length of the AS path in the route update";
+ }
+
+ container match-community-set {
+ description
+ "Top-level container for match conditions on communities.
+ Match a referenced community-set according to the logic
+ defined in the match-set-options leaf";
+
+ leaf community-set {
+ type leafref {
+ path
+ "/rpol:routing-policy/rpol:defined-sets/" +
+ "bp:bgp-defined-sets/bp:community-sets/" +
+ "bp:community-set/bp:community-set-name";
+
+ }
+ description
+ "References a defined community set";
+ }
+
+ uses rpol:match-set-options-group;
+ }
+
+ container match-ext-community-set {
+ description
+ "Match a referenced extended community-set according to the
+ logic defined in the match-set-options leaf";
+
+ leaf ext-community-set {
+ type leafref {
+ path
+ "/rpol:routing-policy/rpol:defined-sets/" +
+ "bp:bgp-defined-sets/bp:ext-community-sets/" +
+ "bp:ext-community-set/" +
+ "bp:ext-community-set-name";
+ }
+ description "References a defined extended community set";
+ }
+
+ uses rpol:match-set-options-group;
+ }
+
+ container match-as-path-set {
+ description
+ "Match a referenced as-path set according to the logic
+ defined in the match-set-options leaf";
+
+ leaf as-path-set {
+ type leafref {
+ path "/rpol:routing-policy/rpol:defined-sets/" +
+ "bp:bgp-defined-sets/bp:as-path-sets/" +
+ "bp:as-path-set/bp:as-path-set-name";
+ }
+ description
+ "References a defined AS path set";
+ }
+ uses rpol:match-set-options-group;
+ }
+ }
+ }
+
+ augment "/rpol:routing-policy/rpol:policy-definitions/" +
+ "rpol:policy-definition/rpol:statements/rpol:statement/" +
+
+ "rpol:actions" {
+ description
+ "BGP policy actions added to routing policy module.";
+
+ container bgp-actions {
+ description
+ "Top-level container for BGP-specific actions";
+
+ leaf set-route-origin {
+ type bt:bgp-origin-attr-type;
+ description
+ "Set the origin attribute to the specified value";
+ }
+
+ leaf set-local-pref {
+ type uint32;
+ description
+ "Set the local pref attribute on the route update";
+ }
+
+ leaf set-next-hop {
+ type bgp-next-hop-type;
+ description
+ "Set the next-hop attribute in the route update";
+ }
+
+ leaf set-med {
+ type bgp-set-med-type;
+ description
+ "Set the med metric attribute in the route update";
+ }
+
+ container set-as-path-prepend {
+ description
+ "Action to prepend local AS number to the AS-path a
+ specified number of times";
+
+ leaf repeat-n {
+ type uint8 {
+ range 1..max;
+ }
+ description
+ "Number of times to prepend the local AS number to the AS
+ path. The value should be between 1 and the maximum
+ supported by the implementation.";
+ }
+ }
+
+ container set-community {
+ description
+ "Action to set the community attributes of the route, along
+ with options to modify how the community is modified.
+ Communities may be set using an inline list OR
+ reference to an existing defined set (not both).";
+
+ uses set-community-action-common;
+ container inline {
+ when "../method = 'INLINE'" {
+ description
+ "Active only when the set-community method is INLINE";
+ }
+ description
+ "Set the community values for the action inline with
+ a list.";
+
+ leaf-list communities {
+ type union {
+ type bt:bgp-std-community-type;
+ type bt:bgp-well-known-community-type;
+ }
+ description
+ "Set the community values for the update inline with a
+ list.";
+ }
+ }
+
+ container reference {
+ when "../method = 'REFERENCE'" {
+ description
+ "Active only when the set-community method is REFERENCE";
+ }
+ description
+ "Provide a reference to a defined community set for the
+ set-community action";
+
+ leaf community-set-ref {
+ type leafref {
+ path "/rpol:routing-policy/rpol:defined-sets/" +
+ "bp:bgp-defined-sets/" +
+ "bp:community-sets/bp:community-set/" +
+ "bp:community-set-name";
+ }
+ description
+ "References a defined community set by name";
+ }
+ }
+
+ }
+
+ container set-ext-community {
+ description
+ "Action to set the extended community attributes of the
+ route, along with options to modify how the community is
+ modified. Extended communities may be set using an inline
+ list OR a reference to an existing defined set (but not
+ both).";
+
+ uses set-community-action-common;
+ container inline {
+ when "../method = 'INLINE'" {
+ description
+ "Active only when the set-community method is INLINE";
+ }
+ description
+ "Set the extended community values for the action inline
+ with a list.";
+
+ leaf-list communities {
+ type union {
+ type rt-types:route-target;
+ type bt:bgp-well-known-community-type;
+ }
+ description
+ "Set the extended community values for the update inline
+ with a list.";
+ }
+ }
+
+ container reference {
+ when "../method = 'REFERENCE'" {
+ description
+ "Active only when the set-community method is REFERENCE";
+ }
+ description
+ "Provide a reference to an extended community set for the
+ set-ext-community action";
+
+ leaf ext-community-set-ref {
+ type leafref {
+ path
+ "/rpol:routing-policy/rpol:defined-sets/" +
+ "bp:bgp-defined-sets/bp:ext-community-sets/" +
+ "bp:ext-community-set/" +
+ "bp:ext-community-set-name";
+ }
+
+ description
+ "References a defined extended community set by name";
+ }
+ }
+ }
+ }
+ }
+
+ // rpc statements
+
+ // notification statements
+}
+
\ No newline at end of file
--- /dev/null
+submodule ietf-bgp-rib-attributes {
+ yang-version "1.1";
+ belongs-to ietf-bgp {
+ prefix "br";
+ }
+
+ // import some basic types
+
+ import ietf-bgp-types {
+ prefix bgpt;
+ }
+
+ import ietf-inet-types {
+ prefix inet;
+ }
+
+ include ietf-bgp-rib-types;
+
+ // meta
+ organization
+ "IETF IDR Working Group";
+
+ contact
+ "WG Web: <http://tools.ietf.org/wg/idr>
+ WG List: <idr@ietf.org>
+
+ Authors: Mahesh Jethanandani (mjethanandani at gmail.com),
+ Keyur Patel (keyur at arrcus.com),
+ Susan Hares (shares at ndzh.com)";
+
+ description
+ "This submodule contains common data definitions for BGP
+ attributes for use in BGP RIB tables.";
+
+
+ revision "2019-06-13" {
+ description
+ "Initial version";
+ reference
+ "RFC XXXX: BGP YANG Model for Service Provider Network";
+ }
+
+ grouping bgp-as-path-attr {
+ description
+ "Data for representing BGP AS-PATH attribute";
+
+ leaf type {
+ type identityref {
+ base bgpt:as-path-segment-type;
+ }
+ description
+ "The type of AS-PATH segment";
+ }
+
+ leaf-list member {
+ type inet:as-number;
+
+ description
+ "List of the AS numbers in the AS-PATH segment";
+ }
+ }
+
+ grouping bgp-community-attr-state {
+ description
+ "Common definition of BGP community attributes";
+
+ leaf-list community {
+ type union {
+ type bgpt:bgp-well-known-community-type;
+ type bgpt:bgp-std-community-type;
+ }
+ description
+ "List of standard or well-known BGP community
+ attributes.";
+ }
+ }
+
+ grouping bgp-unknown-attr-flags-state {
+ description
+ "Operational state data for path attribute flags";
+
+ leaf optional {
+ type boolean;
+ description
+ "Defines whether the attribute is optional (if
+ set to true) or well-known (if set to false).
+ Set in the high-order bit of the BGP attribute
+ flags octet.";
+ reference
+ "RFC 4271 - A Border Gateway Protocol 4 (BGP-4)";
+ }
+
+ leaf transitive {
+ type boolean;
+ description
+ "Defines whether an optional attribute is transitive
+ (if set to true) or non-transitive (if set to false). For
+ well-known attributes, the transitive flag must be set to
+ true. Set in the second high-order bit of the BGP attribute
+ flags octet.";
+ reference
+ "RFC 4271 - A Border Gateway Protocol 4 (BGP-4)";
+ }
+
+ leaf partial {
+
+ type boolean;
+ description
+ "Defines whether the information contained in the optional
+ transitive attribute is partial (if set to true) or complete
+ (if set to false). For well-known attributes and for
+ optional non-transitive attributes, the partial flag
+ must be set to false. Set in the third high-order bit of
+ the BGP attribute flags octet.";
+ reference
+ "RFC 4271 - A Border Gateway Protocol 4 (BGP-4)";
+ }
+
+ leaf extended {
+ type boolean;
+ description
+ "Defines whether the attribute length is one octet
+ (if set to false) or two octets (if set to true). Set in
+ the fourth high-order bit of the BGP attribute flags
+ octet.";
+ reference
+ "RFC 4271 - A Border Gateway Protocol 4 (BGP-4)";
+ }
+ }
+
+ grouping bgp-unknown-attr-state {
+ description
+ "Operational state data for path attributes not shared
+ across route entries, common to LOC-RIB and Adj-RIB";
+
+ leaf attr-type {
+ type uint8;
+ description
+ "1-octet value encoding the attribute type code";
+ reference
+ "RFC 4271 - A Border Gateway Protocol 4 (BGP-4)";
+ }
+
+ leaf attr-len {
+ type uint16;
+ description
+ "One or two octet attribute length field indicating the
+ length of the attribute data in octets. If the Extended
+ Length attribute flag is set, the length field is 2 octets,
+ otherwise it is 1 octet";
+ reference
+ "RFC 4271 - A Border Gateway Protocol 4 (BGP-4)";
+ }
+
+ leaf attr-value {
+ type binary {
+ length 0..65535;
+ }
+ description
+ "Raw attribute value, not including the attribute
+ flags, type, or length. The maximum length
+ of the attribute value data is 2^16-1 per the max value
+ of the attr-len field (2 octets).";
+ reference
+ "RFC 4271 - A Border Gateway Protocol 4 (BGP-4)";
+ }
+ }
+
+ grouping bgp-unknown-attr-top {
+ description
+ "Unknown path attributes that are not expected to be shared
+ across route entries, common to LOC-RIB and Adj-RIB";
+
+ container unknown-attributes {
+ description
+ "Unknown path attributes that were received in the UPDATE
+ message which contained the prefix.";
+
+ list unknown-attribute {
+ key "attr-type";
+ description
+ "This list contains received attributes that are unrecognized
+ or unsupported by the local router. The list may be empty.";
+
+ uses bgp-unknown-attr-flags-state;
+ uses bgp-unknown-attr-state;
+ }
+ }
+ }
+
+ grouping bgp-loc-rib-attr-state {
+ description
+ "Path attributes that are not expected to be shared across
+ route entries, specific to LOC-RIB";
+
+ }
+
+ grouping bgp-adj-rib-attr-state {
+ description
+ "Path attributes that are not expected to be shared across
+ route entries, specific to Adj-RIB";
+
+ leaf path-id {
+ type uint32;
+ description
+ "When the BGP speaker supports advertisement of multiple
+ paths for a prefix, the path identifier is used to
+ uniquely identify a route based on the combination of the
+ prefix and path id. In the Adj-RIB-In, the path-id value is
+ the value received in the update message. In the Loc-RIB,
+ if used, it should represent a locally generated path-id
+ value for the corresponding route. In Adj-RIB-Out, it
+ should be the value sent to a neighbor when add-paths is
+ used, i.e., the capability has been negotiated.";
+ reference
+ "RFC 7911: Advertisement of Multiple Paths in BGP";
+ }
+ }
+}
--- /dev/null
+submodule ietf-bgp-rib-ext {
+ yang-version "1.1";
+ belongs-to ietf-bgp {
+ prefix "bre";
+ }
+
+ include ietf-bgp-rib-types;
+
+ organization
+ "IETF IDR Working Group";
+
+ contact
+ "WG Web: <http://tools.ietf.org/wg/idr>
+ WG List: <idr@ietf.org>
+
+ Authors: Mahesh Jethanandani (mjethanandani at gmail.com),
+
+ Keyur Patel (keyur at arrcus.com),
+ Susan Hares (shares at ndzh.com)";
+
+ description
+ "Defines additional data nodes for the OpenConfig BGP RIB model.
+ These items reflect extensions that are desirable features but
+ are not currently supported in a majority of BGP
+ implementations.";
+
+ revision "2019-06-13" {
+ description
+ "Initial Revision.";
+ reference
+ "RFC XXXX: BGP YANG Model for Service Providers.";
+ }
+
+ grouping rib-ext-route-annotations {
+ description
+ "Extended annotations for routes in the routing tables";
+
+ leaf reject-reason {
+ type union {
+ type identityref {
+ base bgp-not-selected-bestpath;
+ }
+ type identityref {
+ base bgp-not-selected-policy;
+ }
+ }
+ description
+ "Indicates the reason the route is not used, either due to
+ policy filtering or bestpath selection";
+ }
+ }
+}
--- /dev/null
+submodule ietf-bgp-rib-table-attributes {
+ yang-version "1.1";
+ belongs-to ietf-bgp {
+ prefix "br";
+ }
+
+ // import some basic types
+ import ietf-yang-types {
+ prefix types;
+ reference
+ "RFC 6991, Common YANG Data Types.";
+ }
+
+ include ietf-bgp-rib-types;
+
+ organization
+ "IETF IDR Working Group";
+
+ contact
+ "WG Web: <http://tools.ietf.org/wg/idr>
+ WG List: <idr@ietf.org>
+
+ Authors: Mahesh Jethanandani (mjethanandani at gmail.com),
+ Keyur Patel (keyur at arrcus.com),
+ Susan Hares (shares at ndzh.com";
+
+ description
+ "This submodule contains common data definitions for data
+ related to a RIB entry, or RIB table.";
+
+ revision "2019-06-13" {
+ description
+ "Initial version.";
+ reference
+ "RFC XXXX: BGP YANG Model for Service Provider Network.";
+ }
+
+ grouping bgp-common-route-annotations-state {
+ description
+ "Data definitions for flags and other information attached
+ to routes in both LOC-RIB and Adj-RIB";
+
+ leaf last-modified {
+ type types:timeticks;
+ description
+ "Timestamp when this path was last modified.
+
+ The value is the timestamp in seconds relative to
+ the Unix Epoch (Jan 1, 1970 00:00:00 UTC).";
+ }
+
+ leaf valid-route {
+ type boolean;
+ description
+ "Indicates that the route is considered valid by the
+ local router";
+ }
+
+ leaf invalid-reason {
+ type identityref {
+ base invalid-route-reason;
+ }
+ description
+ "If the route is rejected as invalid, this indicates the
+ reason.";
+ }
+ }
+
+ grouping bgp-loc-rib-route-annotations-state {
+ description
+ "Data definitions for information attached to routes in the
+ LOC-RIB";
+
+ // placeholder for route metadata specific to the LOC-RIB
+ }
+
+ grouping bgp-adj-rib-in-post-route-annotations-state {
+ description
+
+ "Data definitions for information attached to routes in the
+ Adj-RIB-in post-policy table";
+
+ leaf best-path {
+ type boolean;
+ description
+ "Current path was selected as the best path.";
+ }
+ }
+
+ grouping bgp-common-table-attrs-state {
+ description
+ "Common attributes attached to all routing tables";
+
+ // placeholder for metadata associated with all tables
+ }
+
+ grouping bgp-common-table-attrs-top {
+ // no enclosing container as this data will fit under an
+ // existing LOC-RIB container
+
+ uses bgp-common-table-attrs-state;
+ description
+ "Operational state data for data related to the entire
+ LOC-RIB";
+ }
+}
--- /dev/null
+submodule ietf-bgp-rib-tables {
+ yang-version "1.1";
+ belongs-to ietf-bgp {
+ prefix "br";
+ }
+
+ // import some basic types
+ import ietf-inet-types {
+ prefix inet;
+ reference
+ "RFC 6991: Common YANG Data Types.";
+ }
+
+ import ietf-yang-types {
+ prefix yang;
+ reference
+ "RFC 6991: Common YANG Data Types.";
+ }
+
+ import ietf-routing {
+ prefix "rt";
+ reference
+ "RFC 8022: A YANG Data Model for Routing Management";
+ }
+
+ include ietf-bgp-rib-ext;
+ include ietf-bgp-rib-attributes;
+ include ietf-bgp-rib-table-attributes;
+
+ organization
+ "IETF IDR Working Group";
+
+ contact
+ "WG Web: <http://tools.ietf.org/wg/idr>
+ WG List: <idr@ietf.org>
+
+ Editor: Mahesh Jethanandani (mjethanandani@gmail.com)
+ Authors: Keyur Patel,
+ Mahesh Jethanandani,
+ Susan Hares";
+
+ description
+ "This submodule contains structural data definitions for
+ BGP routing tables.";
+
+ revision "2019-06-13" {
+ description
+ "Initial Version";
+ reference
+ "RFC XXXX, BGP YANG Model for Service Provider Network.";
+ }
+
+
+ grouping bgp-adj-rib-common-attr-refs {
+ description
+ "Definitions of common references to attribute sets for
+ multiple AFI-SAFIs for Adj-RIB tables";
+
+ leaf attr-index {
+ type leafref {
+ path "../../../../../../../../../attr-sets/" +
+
+ "attr-set/index";
+ }
+ description
+ "Reference to the common attribute group for the
+ route";
+ }
+
+ leaf community-index {
+ type leafref {
+ path "../../../../../../../../../communities/community/" +
+ "index";
+ }
+ description
+ "Reference to the community attribute for the route";
+ }
+
+ leaf ext-community-index {
+ type leafref {
+ path "../../../../../../../../../ext-communities/" +
+ "ext-community/index";
+ }
+ description
+ "Reference to the extended community attribute for the
+ route";
+ }
+ }
+
+ grouping bgp-loc-rib-common-attr-refs {
+ description
+ "Definitions of common references to attribute sets for
+ multiple AFI-SAFIs for LOC-RIB tables";
+
+ leaf attr-index {
+ type leafref {
+ path "../../../../../../../attr-sets/attr-set/" +
+ "index";
+ }
+ description
+ "Reference to the common attribute group for the
+ route";
+ }
+
+ leaf community-index {
+ type leafref {
+ path "../../../../../../../communities/community/" +
+ "index";
+ }
+ description
+
+ "Reference to the community attribute for the route";
+ }
+
+ leaf ext-community-index {
+ type leafref {
+ path "../../../../../../../ext-communities/" +
+ "ext-community/index";
+ }
+ description
+ "Reference to the extended community attribute for the
+ route";
+ }
+ }
+
+ grouping bgp-loc-rib-common-keys {
+ description
+ "Common references used in keys for IPv4 and IPv6
+ LOC-RIB entries";
+
+ leaf origin {
+ type union {
+ type inet:ip-address;
+ type identityref {
+ base rt:routing-protocol;
+ }
+ }
+ description
+ "Indicates the origin of the route. If the route is learned
+ from a neighbor, this value is the neighbor address. If
+ the route was injected or redistributed from another
+ protocol, the origin indicates the source protocol for the
+ route.";
+ }
+
+ leaf path-id {
+ type uint32;
+ // TODO: YANG does not allow default values for key
+ // default 0;
+ description
+ "If the route is learned from a neighbor, the path-id
+ corresponds to the path-id for the route in the
+ corresponding adj-rib-in-post table. If the route is
+ injected from another protocol, or the neighbor does not
+ support BGP add-paths, the path-id should be set
+ to zero, also the default value.";
+ }
+ }
+
+ grouping clear-routes {
+ description
+ "Action to clear BGP routes.";
+
+ container clear-routes {
+ if-feature "clear-routes";
+
+ action clear {
+ input {
+ leaf clear-at {
+ type yang:date-and-time;
+ description
+ "The time, in the future when the clear operation will
+ be initiated.";
+ }
+ }
+
+ output {
+ leaf clear-finished-at {
+ type yang:date-and-time;
+ description
+ "The time when the clear operation finished.";
+ }
+ }
+ }
+ description
+ "Action commands to clear routes governed by a if-feature.";
+ }
+ }
+
+ grouping ipv4-loc-rib {
+ description
+ "Top-level grouping for IPv4 routing tables";
+
+ container loc-rib {
+ config false;
+ description
+ "Container for the IPv4 BGP LOC-RIB data";
+
+ uses bgp-common-table-attrs-top;
+
+ container routes {
+ description
+ "Enclosing container for list of routes in the routing
+ table.";
+
+ list route {
+ key "prefix origin path-id";
+
+ description
+ "List of routes in the table, keyed by the route
+ prefix, the route origin, and path-id. The route
+ origin can be either the neighbor address from which
+ the route was learned, or the source protocol that
+ injected the route. The path-id distinguishes routes
+ for the same prefix received from a neighbor (e.g.,
+ if add-paths is eanbled).";
+
+ leaf prefix {
+ type inet:ipv4-prefix;
+ description
+ "The IPv4 prefix corresponding to the route";
+ }
+
+ uses bgp-loc-rib-common-keys;
+ uses bgp-loc-rib-common-attr-refs;
+ uses bgp-loc-rib-attr-state;
+ uses bgp-common-route-annotations-state;
+ uses bgp-loc-rib-route-annotations-state;
+ uses bgp-unknown-attr-top;
+ uses rib-ext-route-annotations;
+ }
+
+ uses clear-routes;
+ }
+ }
+ }
+
+ grouping ipv6-loc-rib {
+ description
+ "Top-level grouping for IPv6 routing tables";
+
+ container loc-rib {
+ config false;
+ description
+ "Container for the IPv6 BGP LOC-RIB data";
+
+ uses bgp-common-table-attrs-top;
+
+ container routes {
+ description
+ "Enclosing container for list of routes in the routing
+ table.";
+
+ list route {
+ key "prefix origin path-id";
+
+ description
+ "List of routes in the table, keyed by the route
+ prefix, the route origin, and path-id. The route
+ origin can be either the neighbor address from which
+ the route was learned, or the source protocol that
+ injected the route. The path-id distinguishes routes
+ for the same prefix received from a neighbor (e.g.,
+ if add-paths is eanbled).";
+
+ leaf prefix {
+ type inet:ipv6-prefix;
+ description
+ "The IPv6 prefix corresponding to the route";
+ }
+
+ uses bgp-loc-rib-common-keys;
+ uses bgp-loc-rib-common-attr-refs;
+ uses bgp-loc-rib-attr-state;
+ uses bgp-common-route-annotations-state;
+ uses bgp-loc-rib-route-annotations-state;
+ uses bgp-unknown-attr-top;
+ uses rib-ext-route-annotations;
+ }
+
+ uses clear-routes;
+ }
+ }
+ }
+
+ grouping ipv4-adj-rib-common {
+ description
+ "Common structural grouping for each IPv4 adj-RIB table";
+
+ uses bgp-common-table-attrs-top;
+
+ container routes {
+ config false;
+ description
+ "Enclosing container for list of routes in the routing
+ table.";
+
+ list route {
+ key "prefix path-id";
+
+ description
+ "List of routes in the table, keyed by a combination of
+ the route prefix and path-id to distinguish multiple
+ routes received from a neighbor for the same prefix,
+
+ e.g., when BGP add-paths is enabled.";
+
+ leaf prefix {
+ type inet:ipv4-prefix;
+ description
+ "Prefix for the route";
+ }
+
+ uses bgp-adj-rib-attr-state;
+ uses bgp-adj-rib-common-attr-refs;
+ uses bgp-common-route-annotations-state;
+ uses bgp-unknown-attr-top;
+ uses rib-ext-route-annotations;
+ }
+
+ uses clear-routes;
+ }
+ }
+
+ grouping ipv4-adj-rib-in-post {
+ description
+ "Common structural grouping for the IPv4 adj-rib-in
+ post-policy table";
+
+ uses bgp-common-table-attrs-top;
+
+ container routes {
+ config false;
+ description
+ "Enclosing container for list of routes in the routing
+ table.";
+
+ list route {
+ key "prefix path-id";
+
+ description
+ "List of routes in the table, keyed by a combination of
+ the route prefix and path-id to distinguish multiple
+ routes received from a neighbor for the same prefix,
+ e.g., when BGP add-paths is enabled.";
+
+ leaf prefix {
+ type inet:ipv4-prefix;
+ description
+ "Prefix for the route";
+ }
+
+ uses bgp-adj-rib-attr-state;
+
+ uses bgp-adj-rib-common-attr-refs;
+ uses bgp-common-route-annotations-state;
+ uses bgp-adj-rib-in-post-route-annotations-state;
+ uses bgp-unknown-attr-top;
+ uses rib-ext-route-annotations;
+ }
+ }
+ }
+
+
+ grouping ipv4-adj-rib {
+ description
+ "Top-level grouping for Adj-RIB table";
+
+ container neighbors {
+ config false;
+ description
+ "Enclosing container for neighbor list";
+
+ list neighbor {
+ key "neighbor-address";
+ description
+ "List of neighbors (peers) of the local BGP speaker";
+
+ leaf neighbor-address {
+ type inet:ip-address;
+ description
+ "IP address of the BGP neighbor or peer";
+ }
+
+ container adj-rib-in-pre {
+ description
+ "Per-neighbor table containing the NLRI updates
+ received from the neighbor before any local input
+ policy rules or filters have been applied. This can
+ be considered the 'raw' updates from the neighbor.";
+
+ uses ipv4-adj-rib-common;
+
+ }
+
+ container adj-rib-in-post {
+ description
+ "Per-neighbor table containing the paths received from
+ the neighbor that are eligible for best-path selection
+ after local input policy rules have been applied.";
+
+ uses ipv4-adj-rib-in-post;
+
+ }
+
+ container adj-rib-out-pre {
+ description
+ "Per-neighbor table containing paths eligble for
+ sending (advertising) to the neighbor before output
+ policy rules have been applied";
+
+ uses ipv4-adj-rib-common;
+
+ }
+
+ container adj-rib-out-post {
+ description
+ "Per-neighbor table containing paths eligble for
+ sending (advertising) to the neighbor after output
+ policy rules have been applied";
+
+ uses ipv4-adj-rib-common;
+
+ }
+ }
+ }
+ }
+
+ grouping ipv6-adj-rib-common {
+ description
+ "Common structural grouping for each IPv6 adj-RIB table";
+
+ uses bgp-common-table-attrs-state;
+
+ container routes {
+ config false;
+ description
+ "Enclosing container for list of routes in the routing
+ table.";
+
+ list route {
+ key "prefix path-id";
+
+ description
+ "List of routes in the table";
+
+ leaf prefix {
+ type inet:ipv6-prefix;
+ description
+ "Prefix for the route";
+ }
+
+ uses bgp-adj-rib-attr-state;
+ uses bgp-adj-rib-common-attr-refs;
+ uses bgp-common-route-annotations-state;
+ uses bgp-unknown-attr-top;
+ uses rib-ext-route-annotations;
+ }
+
+ uses clear-routes;
+ }
+ }
+
+ grouping ipv6-adj-rib-in-post {
+ description
+ "Common structural grouping for the IPv6 adj-rib-in
+ post-policy table";
+
+ uses bgp-common-table-attrs-state;
+
+ container routes {
+ config false;
+ description
+ "Enclosing container for list of routes in the routing
+ table.";
+
+ list route {
+ key "prefix path-id";
+
+ description
+ "List of routes in the table";
+
+ leaf prefix {
+ type inet:ipv6-prefix;
+ description
+ "Prefix for the route";
+ }
+
+ uses bgp-adj-rib-attr-state;
+ uses bgp-adj-rib-common-attr-refs;
+ uses bgp-common-route-annotations-state;
+ uses bgp-adj-rib-in-post-route-annotations-state;
+ uses bgp-unknown-attr-top;
+ uses rib-ext-route-annotations;
+ }
+ }
+ }
+
+ grouping ipv6-adj-rib {
+ description
+
+ "Top-level grouping for Adj-RIB table";
+
+ container neighbors {
+ config false;
+ description
+ "Enclosing container for neighbor list";
+
+ list neighbor {
+ key "neighbor-address";
+ description
+ "List of neighbors (peers) of the local BGP speaker";
+
+ leaf neighbor-address {
+ type inet:ip-address;
+ description
+ "IP address of the BGP neighbor or peer";
+ }
+
+ container adj-rib-in-pre {
+ description
+ "Per-neighbor table containing the NLRI updates
+ received from the neighbor before any local input
+ policy rules or filters have been applied. This can
+ be considered the 'raw' updates from the neighbor.";
+
+ uses ipv6-adj-rib-common;
+
+ }
+
+ container adj-rib-in-post {
+ description
+ "Per-neighbor table containing the paths received from
+ the neighbor that are eligible for best-path selection
+ after local input policy rules have been applied.";
+
+ uses ipv6-adj-rib-in-post;
+ }
+
+ container adj-rib-out-pre {
+ description
+ "Per-neighbor table containing paths eligble for
+ sending (advertising) to the neighbor before output
+ policy rules have been applied";
+
+ uses ipv6-adj-rib-common;
+
+ }
+
+ container adj-rib-out-post {
+ description
+ "Per-neighbor table containing paths eligble for
+ sending (advertising) to the neighbor after output
+ policy rules have been applied";
+
+ uses ipv6-adj-rib-common;
+
+ }
+ }
+ }
+ }
+}
--- /dev/null
+submodule ietf-bgp-rib-types {
+ yang-version "1.1";
+ belongs-to ietf-bgp {
+ prefix "br";
+ }
+
+ organization
+ "IETF IDR Working Group";
+
+ contact
+ "WG Web: <http://tools.ietf.org/wg/idr>
+ WG List: <idr@ietf.org>
+
+ Authors: Mahesh Jethanandani (mjethanandani at gmail.com),
+ Keyur Patel (keyur at arrcus.com),
+ Susan Hares (shares at ndzh.com)";
+
+ description
+ "Defines identity and type definitions associated with
+ the BGP RIB modules";
+
+ revision "2019-06-13" {
+ description
+ "Initial Version";
+ reference
+ "RFC XXXX, BGP Model for Service Provider Network.";
+ }
+
+ identity invalid-route-reason {
+ description
+ "Base identity for reason code for routes that are rejected as
+ invalid. Some derived entities are based on BMP v3";
+ reference
+ "BGP Monitoring Protocol (draft-ietf-grow-bmp-07)";
+ }
+
+ identity invalid-cluster-loop {
+ base invalid-route-reason;
+ description
+ "Route was invalid due to CLUSTER_LIST loop";
+ }
+
+ identity invalid-as-loop {
+ base invalid-route-reason;
+ description
+ "Route was invalid due to AS_PATH loop";
+ }
+
+ identity invalid-originator {
+ base invalid-route-reason;
+ description
+ "Route was invalid due to ORIGINATOR_ID, e.g., update has
+ local router as originator";
+ }
+
+ identity bgp-not-selected-bestpath {
+ description
+
+ "Base identity for indicating reason a route was was not
+ selected by BGP route selection algorithm";
+ reference
+ "RFC 4271 - Section 9.1";
+ }
+
+ identity local-pref-lower {
+ base bgp-not-selected-bestpath;
+ description
+ "Route has a lower localpref attribute than current best path";
+ reference
+ "RFC 4271 - Section 9.1.2";
+ }
+
+ identity as-path-longer {
+ base bgp-not-selected-bestpath;
+ description
+ "Route has a longer AS path attribute than current best path";
+ reference
+ "RFC 4271 - Section 9.1.2.2 (a)";
+ }
+
+ identity origin-type-higher {
+ base bgp-not-selected-bestpath;
+ description
+ "Route has a higher origin type, i.e., IGP origin is preferred
+ over EGP or incomplete";
+ reference
+ "RFC 4271 - Section 9.1.2.2 (b)";
+ }
+
+ identity med-higher {
+ base bgp-not-selected-bestpath;
+ description
+ "Route has a higher MED, or metric, attribute than the current
+ best path";
+ reference
+ "RFC 4271 - Section 9.1.2.2 (c)";
+ }
+
+ identity prefer-external {
+ base bgp-not-selected-bestpath;
+ description
+ "Route source is via IGP, rather than EGP.";
+ reference
+ "RFC 4271 - Section 9.1.2.2 (d)";
+ }
+
+ identity nexthop-cost-higher {
+ base bgp-not-selected-bestpath;
+ description
+ "Route has a higher interior cost to the next hop.";
+ reference
+ "RFC 4271 - Section 9.1.2.2 (e)";
+ }
+
+ identity higher-router-id {
+ base bgp-not-selected-bestpath;
+ description
+ "Route was sent by a peer with a higher BGP Identifier value,
+ or router id";
+ reference
+ "RFC 4271 - Section 9.1.2.2 (f)";
+ }
+
+ identity higher-peer-address {
+ base bgp-not-selected-bestpath;
+ description
+ "Route was sent by a peer with a higher IP address";
+ reference
+ "RFC 4271 - Section 9.1.2.2 (g)";
+ }
+
+ identity bgp-not-selected-policy {
+ description
+ "Base identity for reason code for routes that are rejected
+ due to policy";
+ }
+
+ identity rejected-import-policy {
+ base bgp-not-selected-policy;
+ description
+ "Route was rejected after apply import policies";
+ }
+}
--- /dev/null
+submodule ietf-bgp-rib {
+ yang-version "1.1";
+ belongs-to ietf-bgp {
+ prefix "br";
+ }
+
+ /*
+ * Import and Include
+ */
+ import ietf-bgp-types {
+ prefix "bt";
+ reference
+ "RFC XXXX: BGP YANG Model for Service Provider Networks.";
+ }
+
+ import ietf-inet-types {
+ prefix inet;
+ reference
+ "RFC 6991: Common YANG Types.";
+ }
+
+ import ietf-yang-types {
+ prefix yang;
+ reference
+ "RFC 6991: Common YANG Types.";
+ }
+
+ import ietf-routing-types {
+ prefix "rt";
+ reference
+ "RFC 8294: Routing Area YANG Types.";
+
+ }
+
+
+ include ietf-bgp-rib-types;
+ include ietf-bgp-rib-tables;
+
+ // groupings of attributes in three categories:
+ // - shared across multiple routes
+ // - common to LOC-RIB and Adj-RIB, but not shared across routes
+ // - specific to LOC-RIB or Adj-RIB
+ include ietf-bgp-rib-attributes;
+
+ // groupings of annotations for each route or table
+ include ietf-bgp-rib-table-attributes;
+
+ organization
+ "IETF IDR Working Group";
+
+ contact
+ "WG Web: <http://tools.ietf.org/wg/idr>
+ WG List: <idr@ietf.org>
+
+ Authors: Mahesh Jethanandani (mjethanandani at gmail.com),
+ Keyur Patel (keyur at arrcus.com),
+ Susan Hares (shares at ndzh.com)";
+
+ description
+ "Defines a submodule for representing BGP routing table (RIB)
+ contents. The submodule supports 5 logical RIBs per address
+ family:
+
+ loc-rib: This is the main BGP routing table for the local routing
+ instance, containing best-path selections for each prefix. The
+ loc-rib table may contain multiple routes for a given prefix,
+ with an attribute to indicate which was selected as the best
+ path. Note that multiple paths may be used or advertised even if
+ only one path is marked as best, e.g., when using BGP
+ add-paths. An implementation may choose to mark multiple
+ paths in the RIB as best path by setting the flag to true for
+ multiple entries.
+
+ adj-rib-in-pre: This is a per-neighbor table containing the NLRI
+ updates received from the neighbor before any local input policy
+ rules or filters have been applied. This can be considered the
+ 'raw' updates from a given neighbor.
+
+ adj-rib-in-post: This is a per-neighbor table containing the
+ routes received from the neighbor that are eligible for
+
+ best-path selection after local input policy rules have been
+ applied.
+
+ adj-rib-out-pre: This is a per-neighbor table containing routes
+ eligible for sending (advertising) to the neighbor before output
+ policy rules have been applied.
+
+ adj-rib-out-post: This is a per-neighbor table containing routes
+ eligible for sending (advertising) to the neighbor after output
+ policy rules have been applied.";
+
+ revision "2019-06-13" {
+ description
+ "Initial Version";
+ reference
+ "RFC XXXX, BGP YANG Model for Service Provider Network.";
+ }
+
+ grouping rib {
+ description
+ "Grouping for rib.";
+
+ container rib {
+ config false;
+
+ container attr-sets {
+ description
+ "Enclosing container for the list of path attribute sets";
+
+ list attr-set {
+ key "index";
+
+ description
+ "List of path attributes that may be in use by multiple
+ routes in the table";
+
+ leaf index {
+ type uint64;
+ description
+ "System generated index for each attribute set. The
+ index is used to reference an attribute set from a
+ specific path. Multiple paths may reference the same
+ attribute set.";
+ }
+
+ leaf origin {
+ type bt:bgp-origin-attr-type;
+ description
+
+ "BGP attribute defining the origin of the path
+ information.";
+ }
+
+ leaf atomic-aggregate {
+ type boolean;
+ description
+ "BGP attribute indicating that the prefix is an atomic
+ aggregate; i.e., the peer selected a less specific
+ route without selecting a more specific route that is
+ included in it.";
+ reference
+ "RFC 4271: Section 5.1.6.";
+ }
+
+ leaf next-hop {
+ type inet:ip-address;
+ description
+ "BGP next hop attribute defining the IP address of the
+ router that should be used as the next hop to the
+ destination";
+ reference
+ "RFC 4271: Section 5.1.3.";
+ }
+
+ leaf med {
+ type uint32;
+ description
+ "BGP multi-exit discriminator attribute used in BGP route
+ selection process";
+ reference
+ "RFC 4271: Section 5.1.4.";
+ }
+
+ leaf local-pref {
+ type uint32;
+ description
+ "BGP local preference attribute sent to internal peers to
+ indicate the degree of preference for externally learned
+ routes. The route with the highest local preference
+ value is preferred.";
+ reference
+ "RFC 4271: Section 5.1.5.";
+ }
+
+ leaf originator-id {
+ type yang:dotted-quad;
+ description
+
+ "BGP attribute that provides the id as an IPv4 address
+ of the originator of the announcement.";
+ reference
+ "RFC 4456 - BGP Route Reflection: An Alternative to Full
+ Mesh Internal BGP (IBGP)";
+ }
+
+ leaf-list cluster-list {
+ type yang:dotted-quad;
+ description
+ "Represents the reflection path that the route has
+ passed.";
+ reference
+ "RFC 4456 - BGP Route Reflection: An Alternative to Full
+ Mesh Internal BGP (IBGP)";
+ }
+
+ leaf aigp-metric {
+ type uint64;
+ description
+ "BGP path attribute representing the accumulated IGP
+ metric for the path";
+ reference
+ "RFC 7311 - The Accumulated IGP Metric Attribute for BGP";
+ }
+ container aggregator {
+ config false;
+ description
+ "BGP attribute indicating the prefix has been
+ aggregated by the specified AS and router.";
+ reference
+ "RFC 4271: Section 5.1.7.";
+
+ leaf as {
+ type inet:as-number;
+ description
+ "AS number of the autonomous system that performed the
+ aggregation.";
+ }
+
+ leaf as4 {
+ type inet:as-number;
+ description
+ "AS number of the autonomous system that performed the
+ aggregation (4-octet representation). This value is
+ populated if an upstream router is not 4-octet capable.
+ Its semantics are similar to the AS4_PATH optional
+ transitive attribute";
+
+ reference
+ "RFC 6793 - BGP Support for Four-octet AS Number Space";
+ }
+
+ leaf address {
+ type inet:ipv4-address;
+ description
+ "IP address of the router that performed the
+ aggregation.";
+ }
+ }
+ container as-path {
+ description
+ "Enclosing container for the list of AS path segments.
+
+ In the Adj-RIB-In or Adj-RIB-Out, this list should show
+ the received or sent AS_PATH, respectively. For
+ example, if the local router is not 4-byte capable, this
+ value should consist of 2-octet ASNs or the AS_TRANS
+ (AS 23456) values received or sent in route updates.
+
+ In the Loc-RIB, this list should reflect the effective
+ AS path for the route, e.g., a 4-octet value if the
+ local router is 4-octet capable.";
+ reference
+ "RFC 4271 - A Border Gateway Protocol 4 (BGP-4)
+ RFC 6793 - BGP Support for Four-octet AS Number Space
+ RFC 5065 - Autonomous System Confederations for BGP";
+
+ list segment {
+ key "type";
+
+ config false;
+ uses bgp-as-path-attr;
+ description
+ "List of AS PATH segments";
+ }
+ }
+ container as4-path {
+ description
+ "This is the path encoded with 4-octet
+ AS numbers in the optional transitive AS4_PATH attribute.
+ This value is populated with the received or sent
+ attribute in Adj-RIB-In or Adj-RIB-Out, respectively.
+ It should not be populated in Loc-RIB since the Loc-RIB
+ is expected to store the effective AS-Path in the
+ as-path leaf regardless of being 4-octet or 2-octet.";
+ reference
+
+ "RFC 6793 - BGP Support for Four-octet AS Number Space";
+
+ list segment {
+ key "type";
+
+ config false;
+ uses bgp-as-path-attr;
+ description
+ "List of AS PATH segments";
+ }
+ }
+ }
+ }
+
+ container communities {
+ description
+ "Enclosing container for the list of community attribute
+ sets";
+
+ list community {
+ key "index";
+
+ config false;
+ description
+ "List of path attributes that may be in use by multiple
+ routes in the table";
+
+ leaf index {
+ type uint64;
+ description
+ "System generated index for each attribute set. The
+ index is used to reference an attribute set from a
+ specific path. Multiple paths may reference the same
+ attribute set.";
+ }
+
+ uses bgp-community-attr-state;
+ }
+ }
+
+ container ext-communities {
+ description
+ "Enclosing container for the list of extended community
+ attribute sets";
+
+ list ext-community {
+ key "index";
+
+ config false;
+ description
+ "List of path attributes that may be in use by multiple
+ routes in the table";
+
+ leaf index {
+ type uint64;
+ description
+ "System generated index for each attribute set. The
+ index is used to reference an attribute set from a
+ specific path. Multiple paths may reference the same
+ attribute set.";
+ }
+
+ leaf-list ext-community {
+ type rt:route-target;
+ description
+ "List of BGP extended community attributes. The received
+ extended community may be an explicitly modeled
+ type or unknown, represented by an 8-octet value
+ formatted according to RFC 4360.";
+ reference
+ "RFC 4360 - BGP Extended Communities Attribute";
+ }
+ }
+ }
+
+ container afi-safis {
+ config false;
+ description
+ "Enclosing container for address family list";
+
+ list afi-safi {
+ key "afi-safi-name";
+ description
+ "List of afi-safi types.";
+
+ leaf afi-safi-name {
+ type identityref {
+ base bt:afi-safi-type;
+ }
+ description "AFI,SAFI name.";
+ }
+
+ container ipv4-unicast {
+ when "../afi-safi-name = 'bt:ipv4-unicast'" {
+ description
+ "Include this container for IPv4 unicast RIB";
+
+ }
+ description
+ "Routing tables for IPv4 unicast -- active when the
+ afi-safi name is ipv4-unicast";
+
+ uses ipv4-loc-rib;
+ uses ipv4-adj-rib;
+ }
+
+ container ipv6-unicast {
+ when "../afi-safi-name = 'bt:ipv6-unicast'" {
+ description
+ "Include this container for IPv6 unicast RIB";
+ }
+ description
+ "Routing tables for IPv6 unicast -- active when the
+ afi-safi name is ipv6-unicast";
+
+ uses ipv6-loc-rib;
+ uses ipv6-adj-rib;
+ }
+ }
+ }
+ description
+ "Top level container for BGP RIB";
+ }
+ }
+}
--- /dev/null
+module ietf-bgp-types {
+ yang-version "1.1";
+ namespace "urn:ietf:params:xml:ns:yang:ietf-bgp-types";
+
+ prefix "bt";
+
+ import ietf-inet-types {
+ prefix inet;
+ }
+
+ // meta
+ organization
+ "IETF IDR Working Group";
+
+ contact
+ "WG Web: <http://tools.ietf.org/wg/idr>
+ WG List: <idr@ietf.org>
+
+ Authors: Mahesh Jethanandani (mjethanandani at gmail.com),
+ Keyur Patel (keyur at arrcus.com),
+ Susan Hares (shares at ndzh.com)";
+
+ description
+ "This module contains general data definitions for use in BGP
+ policy. It can be imported by modules that make use of BGP
+ attributes";
+
+ revision "2019-06-13" {
+ description
+ "Initial Version";
+ reference
+ "RFC XXX, BGP Model for Service Provider Network.";
+ }
+
+ identity bgp-capability {
+ description "Base identity for a BGP capability";
+ }
+
+ identity mp-bgp {
+ base bgp-capability;
+ description
+ "Multi-protocol extensions to BGP";
+ reference
+ "RFC 4760";
+ }
+
+ identity route-refresh {
+ base bgp-capability;
+ description
+ "The BGP route-refresh functionality";
+ reference
+ "RFC2918";
+ }
+
+ identity asn32 {
+ base bgp-capability;
+ description
+ "4-byte (32-bit) AS number functionality";
+ reference
+ "RFC6793";
+ }
+
+ identity graceful-restart {
+ base bgp-capability;
+ description
+ "Graceful restart functionality";
+
+ reference
+ "RFC4724";
+ }
+
+ identity add-paths {
+ base bgp-capability;
+ description
+ "BGP add-paths";
+ reference
+ "RFC 7911.";
+ }
+
+ identity afi-safi-type {
+ description
+ "Base identity type for AFI,SAFI tuples for BGP-4";
+ reference
+ "RFC4760 - multi-protocol extensions for BGP-4";
+ }
+
+ identity ipv4-unicast {
+ base afi-safi-type;
+ description
+ "IPv4 unicast (AFI,SAFI = 1,1)";
+ reference
+ "RFC4760";
+ }
+
+ identity ipv6-unicast {
+ base afi-safi-type;
+ description
+ "IPv6 unicast (AFI,SAFI = 2,1)";
+ reference
+ "RFC4760";
+ }
+
+ identity ipv4-labeled-unicast {
+ base afi-safi-type;
+ description
+ "Labeled IPv4 unicast (AFI,SAFI = 1,4)";
+ reference
+ "RFC3107";
+ }
+
+ identity ipv6-labeled-unicast {
+ base afi-safi-type;
+ description
+ "Labeled IPv6 unicast (AFI,SAFI = 2,4)";
+ reference
+
+ "RFC3107";
+ }
+
+ identity l3vpn-ipv4-unicast {
+ base afi-safi-type;
+ description
+ "Unicast IPv4 MPLS L3VPN (AFI,SAFI = 1,128)";
+ reference
+ "RFC4364";
+ }
+
+ identity l3vpn-ipv6-unicast {
+ base afi-safi-type;
+ description
+ "Unicast IPv6 MPLS L3VPN (AFI,SAFI = 2,128)";
+ reference
+ "RFC4659";
+ }
+
+ identity l3vpn-ipv4-multicast {
+ base afi-safi-type;
+ description
+ "Multicast IPv4 MPLS L3VPN (AFI,SAFI = 1,129)";
+ reference
+ "RFC6514";
+ }
+
+ identity l3vpn-ipv6-multicast {
+ base afi-safi-type;
+ description
+ "Multicast IPv6 MPLS L3VPN (AFI,SAFI = 2,129)";
+ reference
+ "RFC6514";
+ }
+
+ identity l2vpn-vpls {
+ base afi-safi-type;
+ description
+ "BGP-signalled VPLS (AFI,SAFI = 25,65)";
+ reference
+ "RFC4761";
+ }
+
+ identity l2vpn-evpn {
+ base afi-safi-type;
+ description
+ "BGP MPLS Based Ethernet VPN (AFI,SAFI = 25,70)";
+ }
+
+ identity BGP_WELL_KNOWN_STD_COMMUNITY {
+ description
+ "Reserved communities within the standard community space
+ defined by RFC1997. These communities must fall within the
+ range 0xFFFF0000 to 0xFFFFFFFF";
+ reference
+ "RFC 1997";
+ }
+
+ identity NO_EXPORT {
+ base BGP_WELL_KNOWN_STD_COMMUNITY;
+ description
+ "Do not export NLRI received carrying this community outside
+ the bounds of this autonomous system, or this confederation if
+ the local autonomous system is a confederation member AS. This
+ community has a value of 0xFFFFFF01.";
+ reference
+ "RFC1997";
+ }
+
+ identity NO_ADVERTISE {
+ base BGP_WELL_KNOWN_STD_COMMUNITY;
+ description
+ "All NLRI received carrying this community must not be
+ advertised to other BGP peers. This community has a value of
+ 0xFFFFFF02.";
+ reference
+ "RFC1997";
+ }
+
+ identity NO_EXPORT_SUBCONFED {
+ base BGP_WELL_KNOWN_STD_COMMUNITY;
+ description
+ "All NLRI received carrying this community must not be
+ advertised to external BGP peers - including over confederation
+ sub-AS boundaries. This community has a value of 0xFFFFFF03.";
+ reference
+ "RFC1997";
+ }
+
+ identity NOPEER {
+ base BGP_WELL_KNOWN_STD_COMMUNITY;
+ description
+ "An autonomous system receiving NLRI tagged with this community
+ is advised not to re-advertise the NLRI to external bi-lateral
+ peer autonomous systems. An AS may also filter received NLRI
+ from bilateral peer sessions when they are tagged with this
+ community value";
+
+ reference
+ "RFC3765";
+ }
+
+ identity as-path-segment-type {
+ description
+ "Base AS Path Segment Type. In [BGP-4], the path segment type
+ is a 1-octet field with the following values defined.";
+ reference
+ "RFC 4271: A Border Gateway Protocol 4 (BGP-4), Section 4.3.";
+ }
+
+ identity as-set {
+ base as-path-segment-type;
+ description
+ "Unordered set of autonomous systems that a route in the UPDATE
+ message has traversed.";
+ reference
+ "RFC 4271: A Border Gateway Protocol 4 (BGP-4), Section 4.3.";
+ }
+
+ identity as-sequence {
+ base as-path-segment-type;
+ description
+ "Ordered set of autonomous systems that a route in the UPDATE
+ message has traversed.";
+ reference
+ "RFC 4271: A Border Gateway Protocol 4 (BGP-4), Section 4.3.";
+ }
+
+ identity as-confed-sequence {
+ base as-path-segment-type;
+ description
+ "Ordered set of Member Autonomous Systems in the local
+ confederation that the UPDATE message has traversed.";
+ reference
+ "RFC 5065, Autonomous System Configuration for BGP.";
+ }
+
+ identity as-confed-set {
+ base as-path-segment-type;
+ description
+ "Unordered set of Member Autonomous Systems in the local
+ confederation that the UPDATE message has traversed.";
+ reference
+ "RFC 5065, Autonomous System Configuration for BGP.";
+ }
+
+ /*
+ * Features.
+ */
+ feature ttl-security {
+ description
+ "BGP Time To Live (TTL) security check support.";
+ reference
+ "RFC 5082, The Generalized TTL Security Mechanism (GTSM)";
+ }
+
+ feature bfd {
+ description
+ "Support for BFD detection of BGP neighbor reachability.";
+ reference
+ "RFC 5880, Bidirectional Forward Detection (BFD),
+ RFC 5881, Bidirectional Forward Detection for IPv4 and IPv6
+ (Single Hop).
+ RFC 5883, Bidirectional Forwarding Detection (BFD) for Multihop
+ Paths";
+ }
+
+ typedef bgp-session-direction {
+ type enumeration {
+ enum INBOUND {
+ description
+ "Refers to all NLRI received from the BGP peer";
+ }
+ enum OUTBOUND {
+ description
+ "Refers to all NLRI advertised to the BGP peer";
+ }
+ }
+ description
+ "Type to describe the direction of NLRI transmission";
+ }
+
+ typedef bgp-well-known-community-type {
+ type identityref {
+ base BGP_WELL_KNOWN_STD_COMMUNITY;
+ }
+ description
+ "Type definition for well-known IETF community attribute
+ values";
+ reference
+ "IANA Border Gateway Protocol (BGP) Well Known Communities";
+ }
+
+ typedef bgp-std-community-type {
+ // TODO: further refine restrictions and allowed patterns
+ // 4-octet value:
+ // <as number> 2 octets
+ // <community value> 2 octets
+ type union {
+ type uint32 {
+ // per RFC 1997, 0x00000000 - 0x0000FFFF and 0xFFFF0000 -
+ // 0xFFFFFFFF are reserved
+ range "65536..4294901759"; // 0x00010000..0xFFFEFFFF
+ }
+ type string {
+ pattern '([0-9]+:[0-9]+)';
+ }
+ }
+ description
+ "Type definition for standard community attributes";
+ reference
+ "RFC 1997 - BGP Communities Attribute";
+ }
+
+ typedef bgp-ext-community-type {
+ // TODO: needs more work to make this more precise given the
+ // variability of extended community attribute specifications
+ // 8-octet value:
+ // <type> 2 octects
+ // <value> 6 octets
+
+ type union {
+ type string {
+ // Type 1: 2-octet global and 4-octet local
+ // (AS number) (Integer)
+ pattern '(6[0-5][0-5][0-3][0-5]|[1-5][0-9]{4}|' +
+ '[1-9][0-9]{1,4}|[0-9]):' +
+ '(4[0-2][0-9][0-4][0-9][0-6][0-7][0-2][0-9][0-6]|' +
+ '[1-3][0-9]{9}|[1-9]([0-9]{1,7})?[0-9]|[1-9])';
+ }
+ type string {
+ // Type 2: 4-octet global and 2-octet local
+ // (ipv4-address) (integer)
+ pattern '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|' +
+ '25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|' +
+ '2[0-4][0-9]|25[0-5]):' +
+ '(6[0-5][0-5][0-3][0-5]|[1-5][0-9]{4}|' +
+ '[1-9][0-9]{1,4}|[0-9])';
+ }
+ type string {
+ // route-target with Type 1
+
+ // route-target:(ASN):(local-part)
+ pattern 'route\-target:(6[0-5][0-5][0-3][0-5]|' +
+ '[1-5][0-9]{4}|[1-9][0-9]{1,4}|[0-9]):' +
+ '(4[0-2][0-9][0-4][0-9][0-6][0-7][0-2][0-9][0-6]|' +
+ '[1-3][0-9]{9}|[1-9]([0-9]{1,7})?[0-9]|[1-9])';
+ }
+ type string {
+ // route-target with Type 2
+ // route-target:(IPv4):(local-part)
+ pattern 'route\-target:' +
+ '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|' +
+ '25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|' +
+ '2[0-4][0-9]|25[0-5]):' +
+ '(6[0-5][0-5][0-3][0-5]|[1-5][0-9]{4}|' +
+ '[1-9][0-9]{1,4}|[0-9])';
+ }
+ type string {
+ // route-origin with Type 1
+ pattern 'route\-origin:(6[0-5][0-5][0-3][0-5]|' +
+ '[1-5][0-9]{4}|[1-9][0-9]{1,4}|[0-9]):' +
+ '(4[0-2][0-9][0-4][0-9][0-6][0-7][0-2][0-9][0-6]|' +
+ '[1-3][0-9]{9}|[1-9]([0-9]{1,7})?[0-9]|[1-9])';
+ }
+ type string {
+ // route-origin with Type 2
+ pattern 'route\-origin:' +
+ '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|' +
+ '25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|' +
+ '2[0-4][0-9]|25[0-5]):' +
+ '(6[0-5][0-5][0-3][0-5]|[1-5][0-9]{4}|' +
+ '[1-9][0-9]{1,4}|[0-9])';
+ }
+ }
+ description
+ "Type definition for extended community attributes";
+ reference
+ "RFC 4360 - BGP Extended Communities Attribute";
+ }
+
+ typedef bgp-community-regexp-type {
+ // TODO: needs more work to decide what format these regexps can
+ // take.
+ type string;
+ description
+ "Type definition for communities specified as regular
+ expression patterns";
+ }
+
+ typedef bgp-origin-attr-type {
+ type enumeration {
+ enum IGP {
+ description "Origin of the NLRI is internal";
+ }
+ enum EGP {
+ description "Origin of the NLRI is EGP";
+ }
+ enum INCOMPLETE {
+ description "Origin of the NLRI is neither IGP or EGP";
+ }
+ }
+ description
+ "Type definition for standard BGP origin attribute";
+ reference
+ "RFC 4271 - A Border Gateway Protocol 4 (BGP-4), Sec 4.3";
+ }
+
+ typedef peer-type {
+ type enumeration {
+ enum INTERNAL {
+ description "internal (iBGP) peer";
+ }
+ enum EXTERNAL {
+ description "external (eBGP) peer";
+ }
+ }
+ description
+ "Labels a peer or peer group as explicitly internal or
+ external";
+ }
+
+ identity REMOVE_PRIVATE_AS_OPTION {
+ description
+ "Base identity for options for removing private autonomous
+ system numbers from the AS_PATH attribute";
+ }
+
+ identity PRIVATE_AS_REMOVE_ALL {
+ base REMOVE_PRIVATE_AS_OPTION;
+ description
+ "Strip all private autonomous system numbers from the AS_PATH.
+ This action is performed regardless of the other content of the
+ AS_PATH attribute, and for all instances of private AS numbers
+ within that attribute.";
+ }
+
+ identity PRIVATE_AS_REPLACE_ALL {
+
+ base REMOVE_PRIVATE_AS_OPTION;
+ description
+ "Replace all instances of private autonomous system numbers in
+ the AS_PATH with the local BGP speaker's autonomous system
+ number. This action is performed regardless of the other
+ content of the AS_PATH attribute, and for all instances of
+ private AS number within that attribute.";
+ }
+
+ typedef remove-private-as-option {
+ type identityref {
+ base REMOVE_PRIVATE_AS_OPTION;
+ }
+ description
+ "Set of options for configuring how private AS path numbers
+ are removed from advertisements";
+ }
+
+ typedef percentage {
+ type uint8 {
+ range "0..100";
+ }
+ description
+ "Integer indicating a percentage value";
+ }
+
+ typedef rr-cluster-id-type {
+ type union {
+ type uint32;
+ type inet:ipv4-address;
+ }
+ description
+ "Union type for route reflector cluster ids:
+ option 1: 4-byte number
+ option 2: IP address";
+ }
+
+ typedef community-type {
+ type enumeration {
+ enum STANDARD {
+ description
+ "Send only standard communities";
+ }
+ enum EXTENDED {
+ description
+ "Send only extended communities";
+ }
+ enum BOTH {
+
+ description
+ "Send both standard and extended communities";
+ }
+ enum NONE {
+ description
+ "Do not send any community attribute";
+ }
+ }
+ description
+ "Type describing variations of community attributes:
+ STANDARD: standard BGP community [rfc1997]
+ EXTENDED: extended BGP community [rfc4360]
+ BOTH: both standard and extended community";
+ }
+}
--- /dev/null
+module ietf-bgp {
+ yang-version 1.1;
+ namespace "urn:ietf:params:xml:ns:yang:ietf-bgp";
+ prefix bgp;
+
+ /*
+ * Import and Include
+ */
+
+ import ietf-routing {
+ prefix rt;
+ reference
+ "RFC 8349, A YANG Data Model for Routing Management
+ (NMDA Version)";
+ }
+ import ietf-routing-policy {
+ prefix rpol;
+ reference
+ "RFC ZZZZ, A YANG Data Model for Routing Policy Management";
+ }
+ import ietf-interfaces {
+ prefix if;
+ reference
+ "RFC 8343, A YANG Data Model for Interface Management.";
+ }
+ import ietf-bgp-types {
+ prefix bt;
+ reference
+ "RFC XXXX, BGP YANG Model for Service Provider Network.";
+ }
+ import ietf-bfd-types {
+ prefix bfd;
+ reference
+
+ "RFC BBBB, YANG Data Model for Bidirectional Forward Detection.";
+ }
+ import ietf-inet-types {
+ prefix inet;
+ reference
+ "RFC 6991: Common YANG Data Types.";
+ }
+ import ietf-yang-types {
+ prefix yang;
+ reference
+ "RFC 6991: Common YANG Data Types.";
+ }
+
+
+ include ietf-bgp-common;
+ include ietf-bgp-common-multiprotocol;
+ include ietf-bgp-common-structure;
+ include ietf-bgp-neighbor;
+ include ietf-bgp-peer-group;
+ include ietf-bgp-rib-types;
+ include ietf-bgp-rib;
+ include ietf-bgp-rib-ext;
+ include ietf-bgp-rib-attributes;
+ include ietf-bgp-rib-table-attributes;
+ include ietf-bgp-rib-tables;
+
+ organization
+ "IETF IDR Working Group";
+ contact
+ "WG Web: <http://tools.ietf.org/wg/idr>
+ WG List: <idr@ietf.org>
+
+ Authors: Mahesh Jethanandani (mjethanandani at gmail.com),
+ Keyur Patel (keyur at arrcus.com),
+ Susan Hares (shares at ndzh.com";
+ description
+ "This module describes a YANG model for BGP protocol
+ configuration. It is a limited subset of all of the configuration
+ parameters available in the variety of vendor implementations,
+ hence it is expected that it would be augmented with vendor-
+ specific configuration data as needed. Additional modules or
+ submodules to handle other aspects of BGP configuration,
+ including policy, VRFs, VPNs, and additional address families
+ are also expected.
+
+ This model supports the following BGP configuration level
+ hierarchy:
+
+ BGP
+ |
+ +-> [ global BGP configuration ]
+ +-> AFI / SAFI global
+ +-> peer group
+ +-> [ peer group config ]
+ +-> AFI / SAFI [ per-AFI overrides ]
+ +-> neighbor
+ +-> [ neighbor config ]
+ +-> [ optional pointer to peer-group ]
+ +-> AFI / SAFI [ per-AFI overrides ]";
+
+ revision 2019-06-13 {
+ description
+ "Initial Version";
+ reference
+ "RFC XXXX, BGP Model for Service Provider Network ";
+ }
+
+ /*
+ * Identity
+ */
+
+ identity bgp {
+ base rt:routing-protocol;
+ description
+ "BGP protocol.";
+ }
+
+ /*
+ * Feature(s)
+ */
+ feature clear-routes {
+ description
+ "Clearing of BGP routes is supported.";
+ }
+
+ feature clear-neighbors {
+ description
+ "Clearing of BGP neighbors is supported.";
+ }
+
+ feature clear-statistics {
+ description
+ "Clearing of BGP statistics is supported.";
+ }
+
+ /*
+
+ * Containers
+ */
+
+ augment "/rt:routing/rt:control-plane-protocols/"
+ + "rt:control-plane-protocol" {
+ when "derived-from-or-self(rt:type, 'bgp')" {
+ description
+ "This augmentation is valid for a routing protocol
+ instance of BGP.";
+ }
+ description
+ "BGP protocol augmentation of ietf-routing module
+ control-plane-protocol.";
+
+ container bgp {
+ description
+ "Top-level configuration for the BGP router";
+ container global {
+ presence "Enables global configuration of BGP";
+ description
+ "Global configuration for the BGP router";
+
+ leaf as {
+ type inet:as-number;
+ mandatory true;
+ description
+ "Local autonomous system number of the router. Uses
+ the 32-bit as-number type from the model in RFC 6991.";
+ }
+
+ leaf identifier {
+ type yang:dotted-quad;
+ description
+ "BGP Identifier of the router - an unsigned 32-bit,
+ non-zero integer that should be unique within an AS.
+ The value of the BGP Identifier for a BGP speaker is
+ determined upon startup and is the same for every local
+ interface and BGP peer.";
+ reference
+ "RFC 6286: AS-Wide Unique BGP ID for BGP-4. Section 2.1";
+ }
+
+ container default-route-distance {
+ description
+ "Administrative distance (or preference) assigned to
+ routes received from different sources
+ (external, internal, and local).";
+
+ leaf external-route-distance {
+ type uint8 {
+ range "1..255";
+ }
+ description
+ "Administrative distance for routes learned from
+ external BGP (eBGP).";
+ }
+ leaf internal-route-distance {
+ type uint8 {
+ range "1..255";
+ }
+ description
+ "Administrative distance for routes learned from
+ internal BGP (iBGP).";
+ }
+ }
+
+ container confederation {
+ description
+ "Configuration options specifying parameters when the
+ local router is within an autonomous system which is
+ part of a BGP confederation.";
+
+ leaf enabled {
+ type boolean;
+ description
+ "When this leaf is set to true it indicates that
+ the local-AS is part of a BGP confederation";
+ }
+
+ leaf identifier {
+ type inet:as-number;
+ description
+ "Confederation identifier for the autonomous system.";
+ }
+
+ leaf-list member-as {
+ type inet:as-number;
+ description
+ "Remote autonomous systems that are to be treated
+ as part of the local confederation.";
+ }
+ }
+
+ container graceful-restart {
+ description
+ "Parameters relating the graceful restart mechanism for
+
+ BGP";
+ uses graceful-restart-config;
+ }
+
+ uses global-group-use-multiple-paths;
+ uses route-selection-options;
+
+ container afi-safis {
+ description
+ "List of address-families associated with the BGP
+ instance";
+ list afi-safi {
+ key "afi-safi-name";
+
+ description
+ "AFI,SAFI configuration available for the
+ neighbour or group";
+
+ uses mp-afi-safi-config;
+ uses state;
+
+ container graceful-restart {
+ description
+ "Parameters relating to BGP graceful-restart";
+
+ uses mp-afi-safi-graceful-restart-config;
+ }
+
+ uses route-selection-options;
+ uses global-group-use-multiple-paths;
+ uses mp-all-afi-safi-list-contents;
+ }
+ }
+ uses rpol:apply-policy-group;
+ uses state;
+ }
+
+ container neighbors {
+ description
+ "Configuration for BGP neighbors";
+
+ list neighbor {
+ key "remote-address";
+
+ description
+ "List of BGP neighbors configured on the local system,
+ uniquely identified by remote IPv[46] address";
+
+ leaf local-address {
+ type inet:ip-address;
+ config false;
+ description
+ "The local IP address of this entry's BGP connection.";
+ }
+
+ leaf local-port {
+ type inet:port-number {
+ range "0..65535";
+ }
+ config false;
+ description
+ "The local port for the TCP connection between
+ the BGP peers.";
+ }
+
+ leaf peer-group {
+ type leafref {
+ path "../../../peer-groups/peer-group/peer-group-name";
+ }
+ description
+ "The peer-group with which this neighbor is associated";
+ }
+
+ leaf identifier {
+ type yang:dotted-quad;
+ config false;
+ description
+ "The BGP Identifier of this entry's BGP peer.
+ This entry MUST be 0.0.0.0 unless the
+ sessionstate is in the openconfirm or the
+ established state.";
+ reference
+ "RFC 4271, Section 4.2, 'BGP Identifier'.";
+ }
+
+ leaf remote-address {
+ type inet:ip-address;
+ description
+ "The remote IP address of this entry's BGP peer.";
+ }
+
+ leaf remote-port {
+ type inet:port-number {
+ range "0..65535";
+ }
+ config false;
+
+ description
+ "The remote port for the TCP connection
+ between the BGP peers. Note that the
+ objects local-addr, local-port, remote-addr, and
+ reemote-port provide the appropriate
+ reference to the standard MIB TCP
+ connection table.";
+ }
+
+ leaf remote-as {
+ type inet:as-number;
+ config false;
+ description
+ "The remote autonomous system number received in
+ the BGP OPEN message.";
+ reference
+ "RFC 4271, Section 4.2.";
+ }
+
+ leaf enabled {
+ type boolean;
+ default "true";
+ description
+ "Whether the BGP peer is enabled. In cases where the
+ enabled leaf is set to false, the local system should
+ not initiate connections to the neighbor, and should
+ not respond to TCP connections attempts from the
+ neighbor. If the state of the BGP session is
+ ESTABLISHED at the time that this leaf is set to false,
+ the BGP session should be ceased.
+
+ A transition from 'false' to 'true' will cause
+ the BGP Manual Start Event to be generated.
+ A transition from 'true' to 'false' will cause
+ the BGP Manual Stop Event to be generated.
+ This parameter can be used to restart BGP peer
+ connections. Care should be used in providing
+ write access to this object without adequate
+ authentication.";
+ reference
+ "RFC 4271, Section 8.1.2.";
+ }
+
+ uses neighbor-group-config;
+
+ leaf session-state {
+ type enumeration {
+ enum idle {
+
+ description
+ "Neighbor is down, and in the Idle state of the FSM";
+ }
+ enum connect {
+ description
+ "Neighbor is down, and the session is waiting for the
+ underlying transport session to be established";
+ }
+ enum active {
+ description
+ "Neighbor is down, and the local system is awaiting a
+ connection from the remote peer";
+ }
+ enum opensent {
+ description
+ "Neighbor is in the process of being established. The
+ local system has sent an OPEN message";
+ }
+ enum openconfirm {
+ description
+ "Neighbor is in the process of being established.
+ The local system is awaiting a NOTIFICATION or
+ KEEPALIVE message";
+ }
+ enum established {
+ description
+ "Neighbor is up - the BGP session with the peer is
+ established";
+ }
+ }
+ // notification does not like a non-config statement.
+ // config false;
+ description
+ "The BGP peer connection state.";
+ reference
+ "RFC 4271, Section 8.1.2.";
+ }
+
+ leaf last-established {
+ type uint64;
+ config false;
+ description
+ "This timestamp indicates the time that the BGP session
+ last transitioned in or out of the Established state.
+ The value is the timestamp in seconds relative to the
+ Unix Epoch (Jan 1, 1970 00:00:00 UTC).
+
+ The BGP session uptime can be computed by clients as
+
+ the difference between this value and the current time
+ in UTC (assuming the session is in the ESTABLISHED
+ state, per the session-state leaf).";
+ }
+
+ leaf-list supported-capabilities {
+ type identityref {
+ base bt:bgp-capability;
+ }
+ config false;
+ description
+ "BGP capabilities negotiated as supported with the peer";
+ }
+
+ leaf negotiated-hold-time {
+ type decimal64 {
+ fraction-digits 2;
+ }
+ config false;
+ description
+ "The negotiated hold-time for the BGP session";
+ }
+
+ leaf last-error {
+ type binary {
+ length "2";
+ }
+ // notification does not like non-config statement.
+ // config false;
+ description
+ "The last error code and subcode seen by this
+ peer on this connection. If no error has
+ occurred, this field is zero. Otherwise, the
+ first byte of this two byte OCTET STRING
+ contains the error code, and the second byte
+ contains the subcode.";
+ reference
+ "RFC 4271, Section 4.5.";
+ }
+
+ leaf fsm-established-time {
+ type yang:gauge32;
+ units "seconds";
+ config false;
+ description
+ "This timer indicates how long (in
+ seconds) this peer has been in the
+ established state or how long
+
+ since this peer was last in the
+ established state. It is set to zero when
+ a new peer is configured or when the router is
+ booted.";
+ reference
+ "RFC 4271, Section 8.";
+ }
+
+ container timers {
+ description
+ "Timers related to a BGP neighbor";
+
+ uses neighbor-group-timers-config;
+
+ }
+
+ container transport {
+ description
+ "Transport session parameters for the BGP neighbor";
+
+ uses neighbor-group-transport-config;
+ }
+
+ leaf erroneous-update-messages {
+ type uint32;
+ config false;
+ description
+ "The number of BGP UPDATE messages for which the
+ treat-as-withdraw mechanism has been applied based on
+ erroneous message contents";
+ }
+
+ container graceful-restart {
+ description
+ "Parameters relating the graceful restart mechanism for
+ BGP";
+
+ uses graceful-restart-config;
+
+ leaf peer-restart-time {
+ type uint16 {
+ range "0..4096";
+ }
+ config false;
+ description
+ "The period of time (advertised by the peer) that the
+ peer expects a restart of a BGP session to take";
+ }
+
+ leaf peer-restarting {
+ type boolean;
+ config false;
+ description
+ "This flag indicates whether the remote neighbor is
+ currently in the process of restarting, and hence
+ received routes are currently stale";
+ }
+
+ leaf local-restarting {
+ type boolean;
+ config false;
+ description
+ "This flag indicates whether the local neighbor is
+ currently restarting. The flag is unset after all NLRI
+ have been advertised to the peer, and the End-of-RIB
+ (EOR) marker has been unset";
+ }
+
+ leaf mode {
+ type enumeration {
+ enum HELPER_ONLY {
+ description
+ "The local router is operating in helper-only
+ mode, and hence will not retain forwarding state
+ during a local session restart, but will do so
+ during a restart of the remote peer";
+ }
+ enum BILATERAL {
+ description
+ "The local router is operating in both helper
+ mode, and hence retains forwarding state during
+ a remote restart, and also maintains forwarding
+ state during local session restart";
+ }
+ enum REMOTE_HELPER {
+ description
+ "The local system is able to retain routes during
+ restart but the remote system is only able to
+ act as a helper";
+ }
+ }
+ config false;
+ description
+ "This leaf indicates the mode of operation of BGP
+ graceful restart with the peer";
+ }
+ }
+
+ uses structure-neighbor-group-ebgp-multihop;
+ uses structure-neighbor-group-route-reflector;
+ uses structure-neighbor-group-as-path-options;
+ uses structure-neighbor-group-add-paths;
+ uses bgp-neighbor-use-multiple-paths;
+ uses rpol:apply-policy-group;
+
+ container afi-safis {
+ description
+ "Per-address-family configuration parameters associated
+ with the neighbor";
+ uses bgp-neighbor-afi-safi-list;
+ }
+
+ container statistics {
+
+ leaf established-transitions {
+ type yang:counter64;
+ config false;
+ description
+ "Number of transitions to the Established state for the
+ neighbor session. This value is analogous to the
+ bgpPeerFsmEstablishedTransitions object from the standard
+ BGP-4 MIB";
+ reference
+ "RFC 4273 - Definitions of Managed Objects for BGP-4";
+ }
+
+ leaf fsm-established-transitions {
+ type yang:counter32;
+ config false;
+ description
+ "The total number of times the BGP FSM
+ transitioned into the established state
+ for this peer.";
+ reference
+ "RFC 4271, Section 8.";
+ }
+
+ container messages {
+ config false;
+ description
+ "Counters for BGP messages sent and received from the
+ neighbor";
+
+ leaf in-total-messages {
+ type yang:counter32;
+ config false;
+
+ description
+ "The total number of messages received
+ from the remote peer on this connection.";
+ reference
+ "RFC 4271, Section 4.";
+ }
+
+ leaf out-total-messages {
+ type yang:counter32;
+ config false;
+ description
+ "The total number of messages transmitted to
+ the remote peer on this connection.";
+ reference
+ "RFC 4271, Section 4.";
+ }
+
+ leaf in-update-elapsed-time {
+ type yang:gauge32;
+ units "seconds";
+ config false;
+ description
+ "Elapsed time (in seconds) since the last BGP
+ UPDATE message was received from the peer.
+ Each time in-updates is incremented,
+ the value of this object is set to zero (0).";
+ reference
+ "RFC 4271, Section 4.3.
+ RFC 4271, Section 8.2.2, Established state.";
+ }
+
+ container sent {
+ description
+ "Counters relating to BGP messages sent to the
+ neighbor";
+ uses bgp-neighbor-counters-message-types-state;
+ }
+
+ container received {
+ description
+ "Counters for BGP messages received from the
+ neighbor";
+ uses bgp-neighbor-counters-message-types-state;
+ }
+ }
+
+ container queues {
+ config false;
+
+ description
+ "Counters related to queued messages associated with
+ the BGP neighbor";
+
+ leaf input {
+ type uint32;
+ description
+ "The number of messages received from the peer
+ currently queued";
+ }
+
+ leaf output {
+ type uint32;
+ description
+ "The number of messages queued to be sent to the
+ peer";
+ }
+ }
+
+ container clear-statistics {
+ if-feature "clear-statistics";
+
+ action clear {
+ input {
+ leaf clear-at {
+ type yang:date-and-time;
+ description
+ "Time when the clear action needs to be
+ executed.";
+ }
+ }
+
+ output {
+ leaf clear-finished-at {
+ type yang:date-and-time;
+ description
+ "Time when the clear action command completed.";
+ }
+ }
+ }
+ description
+ "Clear statistics action command.";
+ }
+ description
+ "Statistics per neighbor.";
+ }
+ }
+
+ notification established {
+ description
+ "The established event is generated
+ when the BGP FSM enters the established state.";
+
+ leaf remote-address {
+ type leafref {
+ path "../../neighbor/remote-address";
+ }
+ description
+ "IP address of the neighbor that went into established
+ state.";
+ }
+
+ leaf last-error {
+ type leafref {
+ path "../../neighbor/last-error";
+ }
+ description
+ "The last error code and subcode seen by this
+ peer on this connection. If no error has
+ occurred, this field is zero. Otherwise, the
+ first byte of this two byte OCTET STRING
+ contains the error code, and the second byte
+ contains the subcode.";
+ reference
+ "RFC 4271, Section 4.5.";
+ }
+
+ leaf session-state {
+ type leafref {
+ path "../../neighbor/session-state";
+ }
+ description
+ "The BGP peer connection state.";
+ reference
+ "RFC 4271, Section 8.2.2.";
+ }
+ }
+
+ notification backward-transition {
+ description
+ "The backward-transition event is
+ generated when the BGP FSM moves from a higher
+ numbered state to a lower numbered state.";
+
+ leaf remote-addr {
+ type leafref {
+
+ path "../../neighbor/remote-address";
+ }
+ description
+ "IP address of the neighbor that went away from
+ established state.";
+ }
+
+ leaf last-error {
+ type leafref {
+ path "../../neighbor/last-error";
+ }
+ description
+ "The last error code and subcode seen by this
+ peer on this connection. If no error has
+ occurred, this field is zero. Otherwise, the
+ first byte of this two byte OCTET STRING
+ contains the error code, and the second byte
+ contains the subcode.";
+ reference
+ "RFC 4271, Section 4.5.";
+ }
+
+ leaf session-state {
+ type leafref {
+ path "../../neighbor/session-state";
+ }
+ description
+ "The BGP peer connection state.";
+ reference
+ "RFC 4271, Section 8.2.2.";
+ }
+ }
+
+ container clear-neighbors {
+ if-feature "clear-neighbors";
+
+ action clear {
+ input {
+ leaf clear-at {
+ type yang:date-and-time;
+ description
+ "Time when the clear action command needs to be
+ executed.";
+ }
+ }
+
+ output {
+ leaf clear-finished-at {
+
+ type yang:date-and-time;
+ description
+ "Time when the clear action command completed.";
+ }
+ }
+ }
+ description
+ "Clear neighbors action.";
+ }
+ }
+
+ container peer-groups {
+ description
+ "Configuration for BGP peer-groups";
+ uses bgp-peer-group-list;
+ }
+
+ container interfaces {
+ list interface {
+ key "name";
+
+ leaf name {
+ type if:interface-ref;
+ description
+ "Reference to the interface within the routing instance.";
+ }
+
+ container bfd {
+ if-feature "bt:bfd";
+
+ uses bfd:client-cfg-parms;
+ description
+ "BFD client configuration.";
+ reference
+ "RFC BBBB - YANG Data Model for Bidirectional Forwarding
+ Detection.";
+ }
+ description
+ "List of interfaces within the routing instance.";
+ }
+ description
+ "Interface specific parameters.";
+ }
+ uses rib;
+ }
+ }
+}
--- /dev/null
+module ietf-flexible-encapsulation {
+ yang-version 1.1;
+ namespace
+ "urn:ietf:params:xml:ns:yang:ietf-flexible-encapsulation";
+
+ prefix flex;
+
+ import ietf-interfaces {
+ prefix if;
+ }
+
+ import iana-if-type {
+ prefix ianaift;
+ }
+
+ import ietf-interfaces-common {
+ prefix if-cmn;
+ }
+
+ import ieee802-dot1q-types {
+ prefix dot1q-types;
+ }
+
+ organization
+ "IETF NETMOD (NETCONF Data Modeling Language) Working Group";
+
+ contact
+ "WG Web: <http://tools.ietf.org/wg/netmod/>
+ WG List: <mailto:netmod@ietf.org>
+
+ WG Chair: Lou Berger
+ <mailto:lberger@labn.net>
+
+ WG Chair: Kent Watsen
+ <mailto:kwatsen@juniper.net>
+
+ Editor: Robert Wilton
+ <mailto:rwilton@cisco.com>";
+
+ description
+ "This YANG module describes interface configuration for flexible
+ VLAN matches and rewrites.";
+
+ revision 2017-10-30 {
+ description "Latest draft revision";
+
+ reference
+
+ "Internet-Draft draft-ietf-netmod-sub-intf-vlan-model-03";
+ }
+
+ feature flexible-rewrites {
+ description
+ "This feature indicates whether the network element supports
+ specifying flexible rewrite operations";
+ }
+
+ feature asymmetric-rewrites {
+ description
+ "This feature indicates whether the network element supports
+ specifying different rewrite operations for the ingress
+ rewrite operation and egress rewrite operation.";
+ }
+
+ feature dot1q-tag-rewrites {
+ description
+ "This feature indicates whether the network element supports
+ the flexible rewrite functionality specifying flexible 802.1Q
+ tag rewrites";
+ }
+
+ /*
+ * flexible-match grouping.
+ *
+ * This grouping represents a flexible match.
+ *
+ * The rules for a flexible match are:
+ * 1. default, untagged, priority tag, or a stack of tags.
+ * - Each tag in the stack of tags matches:
+ * 1. tag type (802.1Q or 802.1ad) +
+ * 2. tag value:
+ * i. single tag
+ * ii. set of tag ranges/values.
+ * iii. "any" keyword
+ */
+ grouping flexible-match {
+ description "Flexible match";
+ choice match-type {
+ mandatory true;
+ description "Provides a choice of how the frames may be
+ matched";
+
+ case default {
+ description "Default match";
+ leaf default {
+ type empty;
+
+ description
+ "Default match. Matches all traffic not matched to any
+ other peer sub-interface by a more specific
+ encapsulation.";
+ } // leaf default
+ } // case default
+
+ case untagged {
+ description "Match untagged Ethernet frames only";
+ leaf untagged {
+ type empty;
+ description
+ "Untagged match. Matches all untagged traffic.";
+ } // leaf untagged
+ } // case untagged
+
+ case dot1q-priority-tagged {
+ description
+ "Match 802.1Q priority tagged Ethernet frames only";
+
+ container dot1q-priority-tagged {
+ description "802.1Q priority tag match";
+ leaf tag-type {
+ type dot1q-types:dot1q-tag-type;
+ description "The 802.1Q tag type of matched priority
+ tagged packets";
+ }
+ }
+ }
+
+ case dot1q-vlan-tagged {
+ container dot1q-vlan-tagged {
+ description "Matches VLAN tagged frames";
+
+ container outer-tag {
+ presence "The outermost VLAN tag exists";
+
+ description
+ "Classifies traffic using the outermost VLAN tag on the
+ frame.";
+
+ uses
+ 'dot1q-types:'+
+ 'dot1q-tag-ranges-or-any-classifier-grouping';
+ }
+
+ container second-tag {
+ must
+
+ '../outer-tag/tag-type = "dot1q-types:s-vlan" and ' +
+ 'tag-type = "dot1q-types:c-vlan"' {
+
+ error-message
+ "When matching two tags, the outermost tag must be
+ specified and of S-VLAN type and the second
+ outermost tag must be of C-VLAN tag type";
+
+ description
+ "For IEEE 802.1Q interoperability, when matching two
+ tags, it is required that the outermost tag exists
+ and is an S-VLAN, and the second outermost tag is a
+ C-VLAN";
+ }
+
+ presence "The second outermost VLAN tag exists";
+
+ description
+ "Classifies traffic using the second outermost VLAN tag
+ on the frame.";
+
+ uses
+ 'dot1q-types:'+
+ 'dot1q-tag-ranges-or-any-classifier-grouping';
+ }
+
+ leaf match-exact-tags {
+ type empty;
+ description
+ "If set, indicates that all 802.1Q VLAN tags in the
+ Ethernet frame header must be explicitly matched, i.e.
+ the EtherType following the matched tags must not be a
+ 802.1Q tag EtherType. If unset then extra 802.1Q VLAN
+ tags are allowed.";
+ }
+ }
+ }
+ } // encaps-type
+ }
+
+ /*
+ * Grouping for tag-rewrite that can be expressed either
+ * symmetrically, or in the ingress and/or egress directions
+ * independently.
+ */
+ grouping dot1q-tag-rewrite {
+ description "Flexible rewrite";
+ leaf pop-tags {
+
+ type uint8 {
+ range 1..2;
+ }
+ description "The number of tags to pop (or translate if used in
+ conjunction with push-tags)";
+ }
+
+ container push-tags {
+ description "The 802.1Q tags to push (or translate if used in
+ conjunction with pop-tags)";
+
+ container outer-tag {
+ presence
+ "Indicates existence of the outermost VLAN tag to
+ push/rewrite";
+
+ description
+ "The outermost VLAN tag to push onto the frame.";
+
+ uses dot1q-types:dot1q-tag-classifier-grouping;
+ }
+
+ container second-tag {
+ must
+ '../outer-tag/tag-type = "dot1q-types:s-vlan" and ' +
+ 'tag-type = "dot1q-types:c-vlan"' {
+
+ error-message
+ "When pushing/rewriting two tags, the outermost tag must be
+ specified and of S-VLAN type and the second outermost tag
+ must be of C-VLAN tag type";
+
+ description
+ "For IEEE 802.1Q interoperability, when pushing two tags,
+ it is required that the outermost tag exists and is an
+ S-VLAN, and the second outermost tag is a C-VLAN";
+ }
+
+ presence
+ "Indicates existence of a second outermost VLAN tag to
+ push/rewrite.";
+
+ description
+ "The second outermost VLAN tag to push onto the frame.";
+
+ uses dot1q-types:dot1q-tag-classifier-grouping;
+ }
+ }
+
+ }
+
+ /*
+ * Grouping for all flexible rewrites of fields in the L2 header.
+ *
+ * This currently only includes flexible tag rewrites, but is
+ * designed to be extensible to cover rewrites of other fields in
+ * the L2 header if required.
+ */
+ grouping flexible-rewrite {
+ description "Flexible rewrite";
+
+ /*
+ * Tag rewrite.
+ *
+ * All tag rewrites are formed using a combination of pop-tags
+ * and push-tags operations.
+ */
+ container dot1q-tag-rewrite {
+ if-feature dot1q-tag-rewrites;
+ description "Tag rewrite. Translate operations are expressed
+ as a combination of tag push and pop operations.";
+ uses dot1q-tag-rewrite;
+ }
+ }
+ augment "/if:interfaces/if:interface/if-cmn:encapsulation/" +
+ "if-cmn:encaps-type" {
+ when
+ "derived-from-or-self(../if:type,
+ 'ianaift:ethernetCsmacd') or
+ derived-from-or-self(../if:type,
+ 'ianaift:ieee8023adLag') or
+ derived-from-or-self(../if:type,
+ 'if-cmn:ethSubInterface')" {
+ description
+ "Applies only to Ethernet-like interfaces and
+ sub-interfaces";
+ }
+ description
+ "Add flexible match and rewrite for VLAN sub-interfaces";
+
+ /*
+ * A flexible encapsulation allows for the matching of ranges and
+ * sets of VLAN Ids. The structure is also designed to be
+ * extended to allow for matching/rewriting other fields within
+ * the L2 frame header if required.
+ */
+ case flexible {
+
+ description "Flexible encapsulation and rewrite";
+ container flexible {
+ must
+ 'count(../../if-cmn:forwarding-mode) = 0 or ' +
+ 'derived-from-or-self(../../if-cmn:forwarding-mode,' +
+ '"if-cmn:layer-2-forwarding")' {
+ error-message
+ "If the interface forwarding-mode leaf is set then it
+ must be set to an identity that derives from
+ layer-2-forwarding";
+
+ description
+ "The forwarding-mode leaf on an interface can
+ optionally be used to enforce consistency of
+ configuration";
+ }
+
+ description "Flexible encapsulation and rewrite";
+
+ container match {
+ description
+ "The match used to classify frames to this interface";
+ uses flexible-match;
+ }
+
+ container rewrite {
+ if-feature flexible-rewrites;
+ description "L2 frame rewrite operations";
+ choice direction {
+ description
+ "Whether the rewrite policy is symmetrical or
+ asymmetrical";
+ case symmetrical {
+ container symmetrical {
+ uses flexible-rewrite;
+ description
+ "Symmetrical rewrite. Expressed in the ingress
+ direction, but the reverse operation is applied to
+ egress traffic";
+ }
+ }
+
+ /*
+ * Allow asymmetrical rewrites to be specified.
+ */
+ case asymmetrical {
+ if-feature asymmetric-rewrites;
+ description "Asymmetrical rewrite";
+
+ container ingress {
+ uses flexible-rewrite;
+ description "Ingress rewrite";
+ }
+ container egress {
+ uses flexible-rewrite;
+ description "Egress rewrite";
+ }
+ }
+ }
+ }
+
+ /*
+ * For encapsulations that match a range of VLANs (or Any),
+ * allow configuration to specify the default 802.1Q VLAN tag
+ * values to use for any traffic that is locally sourced from
+ * an interface on the device.
+ */
+ container local-traffic-default-encaps {
+ presence
+ "A local traffic default encapsulation has been
+ specified";
+ description
+ "The 802.1Q VLAN tags to use by default for locally
+ sourced traffic";
+
+ container outer-tag {
+ presence
+ "Indicates existence of the outermost VLAN tag";
+
+ description
+ "The outermost VLAN tag for locally sourced traffic";
+
+ uses dot1q-types:dot1q-tag-classifier-grouping;
+ }
+
+ container second-tag {
+ must
+ '../outer-tag/tag-type = "dot1q-types:s-vlan" and ' +
+ 'tag-type = "dot1q-types:c-vlan"' {
+
+ error-message
+ "When specifying two tags, the outermost tag must be
+ specified and of S-VLAN type and the second outermost
+ tag must be of C-VLAN tag type";
+
+ description
+ "For IEEE 802.1Q interoperability, when specifying two
+
+ tags, it is required that the outermost tag exists and
+ is an S-VLAN, and the second outermost tag is a
+ C-VLAN";
+ }
+
+ presence
+ "Indicates existence of a second outermost VLAN tag.";
+
+ description
+ "The second outermost VLAN tag for locally sourced
+ traffic";
+
+ uses dot1q-types:dot1q-tag-classifier-grouping;
+ }
+ }
+ }
+ }
+ }
+}
--- /dev/null
+module ietf-if-l3-vlan {
+
+ yang-version 1.1;
+
+ namespace "urn:ietf:params:xml:ns:yang:ietf-if-l3-vlan";
+
+ prefix if-l3-vlan;
+
+ import ietf-interfaces {
+ prefix if;
+ }
+
+ import iana-if-type {
+ prefix ianaift;
+ }
+
+ import ieee802-dot1q-types {
+ prefix dot1q-types;
+ }
+
+ import ietf-interfaces-common {
+ prefix if-cmn;
+ }
+
+ organization
+ "IETF NETMOD (NETCONF Data Modeling Language) Working Group";
+
+ contact
+ "WG Web: <http://tools.ietf.org/wg/netmod/>
+ WG List: <mailto:netmod@ietf.org>
+
+ WG Chair: Lou Berger
+ <mailto:lberger@labn.net>
+
+ WG Chair: Kent Watsen
+ <mailto:kwatsen@juniper.net>
+
+ Editor: Robert Wilton
+ <mailto:rwilton@cisco.com>";
+
+ description
+ "This YANG module models L3 VLAN sub-interfaces";
+
+ revision 2017-10-30 {
+ description "Latest draft revision";
+
+ reference
+ "Internet-Draft draft-ietf-netmod-sub-intf-vlan-model-03";
+ }
+
+ /*
+ * Add support for the 802.1Q VLAN encapsulation syntax on layer 3
+ * terminated VLAN sub-interfaces.
+ */
+ augment "/if:interfaces/if:interface/if-cmn:encapsulation/" +
+ "if-cmn:encaps-type" {
+ when
+ "derived-from-or-self(../if:type,
+ 'ianaift:ethernetCsmacd') or
+ derived-from-or-self(../if:type,
+ 'ianaift:ieee8023adLag') or
+ derived-from-or-self(../if:type,
+ 'if-cmn:ethSubInterface')" {
+ description
+ "Applies only to Ethernet-like interfaces and
+ sub-interfaces";
+ }
+
+ description
+ "Augment the generic interface encapsulation with an
+ basic 802.1Q VLAN encapsulation for sub-interfaces.";
+
+ /*
+ * Matches a single VLAN Id, or pair of VLAN Ids to classify
+ * traffic into an L3 service.
+ */
+ case dot1q-vlan {
+ container dot1q-vlan {
+ must
+ 'count(../../if-cmn:forwarding-mode) = 0 or ' +
+ 'derived-from-or-self(../../if-cmn:forwarding-mode,' +
+ '"if-cmn:layer-3-forwarding")' {
+ error-message
+ "If the interface forwarding-mode leaf is set then it
+ must be set to an identity that derives from
+ layer-3-forwarding";
+
+ description
+ "The forwarding-mode leaf on an interface can
+ optionally be used to enforce consistency of
+ configuration";
+ }
+
+
+ description
+ "Match VLAN tagged frames with specific VLAN Ids";
+ container outer-tag {
+ presence "The outermost VLAN tag exists";
+
+ description
+ "Classifies traffic using the outermost VLAN tag on the
+ frame.";
+
+ uses dot1q-types:dot1q-tag-classifier-grouping;
+ }
+
+ container second-tag {
+ must
+ '../outer-tag/tag-type = "dot1q-types:s-vlan" and ' +
+ 'tag-type = "dot1q-types:c-vlan"' {
+
+ error-message
+ "When matching two tags, the outermost tag must be
+ specified and of S-VLAN type and the second outermost
+ tag must be of C-VLAN tag type";
+
+ description
+ "For IEEE 802.1Q interoperability, when matching two
+ tags, it is required that the outermost tag exists and
+ is an S-VLAN, and the second outermost tag is a
+ C-VLAN";
+ }
+
+ presence "The second outermost VLAN tag exists";
+
+ description
+ "Classifies traffic using the second outermost VLAN tag
+ on the frame.";
+
+ uses dot1q-types:dot1q-tag-classifier-grouping;
+ }
+ }
+ }
+ }
+}
--- /dev/null
+ module ietf-interfaces-common {
+ yang-version 1.1;
+
+ namespace "urn:ietf:params:xml:ns:yang:ietf-interfaces-common";
+
+ prefix if-cmn;
+
+ import ietf-yang-types {
+ prefix yang;
+ }
+
+ import ietf-interfaces {
+ prefix if;
+ }
+
+ import iana-if-type {
+ prefix ianaift;
+ }
+
+ organization
+ "IETF NETMOD (NETCONF Data Modeling Language) Working Group";
+
+ contact
+ "WG Web: <http://tools.ietf.org/wg/netmod/>
+ WG List: <mailto:netmod@ietf.org>
+
+ WG Chair: Lou Berger
+ <mailto:lberger@labn.net>
+
+ WG Chair: Joel Jaeggli
+ <mailto:joelja@gmail.com>
+
+ WG Chair: Kent Watsen
+ <mailto:kwatsen@juniper.net>
+
+ Editor: Robert Wilton
+ <mailto:rwilton@cisco.com>";
+
+ description
+ "This module contains common definitions for extending the IETF
+ interface YANG model (RFC 8343) with common configurable layer 2
+ properties.
+
+ Copyright (c) 2016-2019 IETF Trust and the persons identified
+ as authors of the code. All rights reserved.
+
+ Redistribution and use in source and binary forms, with or
+ without modification, is permitted pursuant to, and subject
+
+ to the license terms contained in, the Simplified BSD License
+ set forth in Section 4.c of the IETF Trust's Legal Provisions
+ Relating to IETF Documents
+ (http://trustee.ietf.org/license-info).
+
+ This version of this YANG module is part of XXX; see the RFC
+ itself for full legal notices.";
+
+ revision 2019-03-05 {
+ description
+ "Initial version";
+
+ reference "Internet draft: draft-ietf-netmod-intf-ext-yang-07";
+ }
+
+ feature carrier-delay {
+ description
+ "This feature indicates that configurable interface
+ carrier delay is supported, which is a feature is used to
+ limit the propagation of very short interface link state
+ flaps.";
+ reference "RFC XXX, Section 3.1 Carrier Delay";
+ }
+
+ feature dampening {
+ description
+ "This feature indicates that the device supports interface
+ dampening, which is a feature that is used to limit the
+ propagation of interface link state flaps over longer
+ periods";
+ reference "RFC XXX, Section 3.2 Dampening";
+ }
+
+ feature loopback {
+ description
+ "This feature indicates that configurable interface loopback
+ is supported.";
+ reference "RFC XXX, Section 3.4 Loopback";
+ }
+
+ feature configurable-l2-mtu {
+ description
+ "This feature indicates that the device supports configuring
+ layer 2 MTUs on interfaces. Such MTU configurations include
+ the layer 2 header overheads (but exclude any FCS overhead).
+ The payload MTU available to higher layer protocols is either
+ derived from the layer 2 MTU, taking into account the size of
+ the layer 2 header, or is further restricted by explicit layer
+
+ 3 or protocol specific MTU configuration.";
+ reference "RFC XXX, Section 3.5 Layer 2 MTU";
+ }
+
+ feature sub-interfaces {
+ description
+ "This feature indicates that the device supports the
+ instantiation of sub-interfaces. Sub-interfaces are defined
+ as logical child interfaces that allow features and forwarding
+ decisions to be applied to a subset of the traffic processed
+ on the specified parent interface.";
+ reference "RFC XXX, Section 3.6 Sub-interface";
+ }
+
+ feature forwarding-mode {
+ description
+ "This feature indicates that the device supports the
+ configurable forwarding mode leaf";
+ reference "RFC XXX, Section 3.7 Forwarding Mode";
+ }
+
+ /*
+ * Define common identities to help allow interface types to be
+ * assigned properties.
+ */
+ identity sub-interface {
+ description
+ "Base type for generic sub-interfaces.
+
+ New or custom interface types can derive from this type to
+ inherit generic sub-interface configuration";
+ reference "RFC XXX, Section 3.6 Sub-interface";
+ }
+
+ identity ethSubInterface{
+ base ianaift:l2vlan;
+ base sub-interface;
+
+ description
+ "This identity represents the child sub-interface of any
+ interface types that uses Ethernet framing (with or without
+ 802.1Q tagging)";
+ }
+
+ identity loopback {
+ description "Base identity for interface loopback options";
+ reference "RFC XXX, section 3.4";
+ }
+
+ identity loopback-internal {
+ base loopback;
+ description
+ "All egress traffic on the interface is internally looped back
+ within the interface to be received on the ingress path.";
+ reference "RFC XXX, section 3.4";
+ }
+ identity loopback-line {
+ base loopback;
+ description
+ "All ingress traffic received on the interface is internally
+ looped back within the interface to the egress path.";
+ reference "RFC XXX, section 3.4";
+ }
+ identity loopback-connector {
+ base loopback;
+ description
+ "The interface has a physical loopback connector attached
+ that loops all egress traffic back into the interface's
+ ingress path, with equivalent semantics to loopback-internal";
+ reference "RFC XXX, section 3.4";
+ }
+
+ identity forwarding-mode {
+ description "Base identity for forwarding-mode options.";
+ reference "RFC XXX, section 3.7";
+ }
+ identity optical-layer {
+ base forwarding-mode;
+ description
+ "Traffic is being forwarded at the optical layer. This
+ includes DWDM or OTN based switching.";
+ reference "RFC XXX, section 3.7";
+ }
+ identity layer-2-forwarding {
+ base forwarding-mode;
+ description
+ "Layer 2 based forwarding, such as Ethernet/VLAN based
+ switching, or L2VPN services.";
+ reference "RFC XXX, section 3.7";
+ }
+ identity network-layer {
+ base forwarding-mode;
+ description
+ "Network layer based forwarding, such as IP, MPLS, or L3VPNs.";
+ reference "RFC XXX, section 3.7";
+ }
+
+ /*
+ * Augments the IETF interfaces model with leaves to configure
+ * and monitor carrier-delay on an interface.
+ */
+ augment "/if:interfaces/if:interface" {
+ description
+ "Augments the IETF interface model with optional common
+ interface level commands that are not formally covered by any
+ specific standard.";
+
+ /*
+ * Defines standard YANG for the Carrier Delay feature.
+ */
+ container carrier-delay {
+ if-feature "carrier-delay";
+ description
+ "Holds carrier delay related feature configuration";
+ leaf down {
+ type uint32;
+ units milliseconds;
+ description
+ "Delays the propagation of a 'loss of carrier signal' event
+ that would cause the interface state to go down, i.e. the
+ command allows short link flaps to be suppressed. The
+ configured value indicates the minimum time interval (in
+ milliseconds) that the carrier signal must be continuously
+ down before the interface state is brought down. If not
+ configured, the behaviour on loss of carrier signal is
+ vendor/interface specific, but with the general
+ expectation that there should be little or no delay.";
+ }
+ leaf up {
+ type uint32;
+ units milliseconds;
+ description
+ "Defines the minimum time interval (in milliseconds) that
+ the carrier signal must be continuously present and error
+ free before the interface state is allowed to transition
+ from down to up. If not configured, the behaviour is
+ vendor/interface specific, but with the general
+ expectation that sufficient default delay should be used
+ to ensure that the interface is stable when enabled before
+ being reported as being up. Configured values that are
+ too low for the hardware capabilties may be rejected.";
+ }
+ leaf carrier-transitions {
+ type yang:counter64;
+ units transitions;
+
+ config false;
+ description
+ "Defines the number of times the underlying carrier state
+ has changed to, or from, state up. This counter should be
+ incremented even if the high layer interface state changes
+ are being suppressed by a running carrier-delay timer.";
+ }
+ leaf timer-running {
+ type enumeration {
+ enum none {
+ description
+ "No carrier delay timer is running.";
+ }
+ enum up {
+ description
+ "Carrier-delay up timer is running. The underlying
+ carrier state is up, but interface state is not
+ reported as up.";
+ }
+ enum down {
+ description
+ "Carrier-delay down timer is running. Interface state
+ is reported as up, but the underlying carrier state is
+ actually down.";
+ }
+ }
+ default "none";
+ config false;
+ description
+ "Reports whether a carrier delay timer is actively running,
+ in which case the interface state does not match the
+ underlying carrier state.";
+ }
+
+ reference "RFC XXX, Section 3.1 Carrier Delay";
+ }
+
+ /*
+ * Augments the IETF interfaces model with a container to hold
+ * generic interface dampening
+ */
+ container dampening {
+ if-feature "dampening";
+ presence
+ "Enable interface link flap dampening with default settings
+ (that are vendor/device specific)";
+ description
+ "Interface dampening limits the propagation of interface link
+
+ state flaps over longer periods";
+ reference "RFC XXX, Section 3.2 Dampening";
+ leaf half-life {
+ type uint32;
+ units seconds;
+ description
+ "The Time (in seconds) after which a penalty reaches half
+ its original value. Once the interface has been assigned
+ a penalty, the penalty is decreased by half after the
+ half-life period. For some devices, the allowed values may
+ be restricted to particular multiples of seconds. The
+ default value is vendor/device specific.";
+ reference "RFC XXX, Section 3.3.2 Half-Life Period";
+ }
+ leaf reuse {
+ type uint32;
+ description
+ "Penalty value below which a stable interface is
+ unsuppressed (i.e. brought up) (no units). The default
+ value is vendor/device specific. The penalty value for a
+ link up->down state change is nominally 1000 units.";
+ reference "RFC XXX, Section 3.2.3 Reuse Threshold";
+ }
+
+ leaf suppress {
+ type uint32;
+ description
+ "Limit at which an interface is suppressed (i.e. held down)
+ when its penalty exceeds that limit (no units). The value
+ must be greater than the reuse threshold. The default
+ value is vendor/device specific. The penalty value for a
+ link up->down state change is nominally 1000 units.";
+ reference "RFC XXX, Section 3.2.1 Suppress Threshold";
+ }
+
+ leaf max-suppress-time {
+ type uint32;
+ units seconds;
+ description
+ "Maximum time (in seconds) that an interface can be
+ suppressed. This value effectively acts as a ceiling that
+ the penalty value cannot exceed. The default value is
+ vendor/device specific.";
+ reference "RFC XXX, Section 3.2.4 Maximum Suppress Time";
+ }
+
+ leaf penalty {
+ type uint32;
+
+ config false;
+ description
+ "The current penalty value for this interface. When the
+ penalty value exceeds the 'suppress' leaf then the
+ interface is suppressed (i.e. held down).";
+ reference "RFC XXX, Section 3.2 Dampening";
+ }
+
+ leaf suppressed {
+ type boolean;
+ default "false";
+ config false;
+ description
+ "Represents whether the interface is suppressed (i.e. held
+ down) because the 'penalty' leaf value exceeds the
+ 'suppress' leaf.";
+ reference "RFC XXX, Section 3.2 Dampening";
+ }
+
+ leaf time-remaining {
+ when '../suppressed = "true"' {
+ description
+ "Only suppressed interfaces should have a time remaining.";
+ }
+ type uint32;
+ units seconds;
+ config false;
+ description
+ "For a suppressed interface, this leaf represents how long
+ (in seconds) that the interface will remain suppressed
+ before it is allowed to go back up again.";
+ reference "RFC XXX, Section 3.2 Dampening";
+ }
+ }
+
+ /*
+ * Various types of interfaces support a configurable layer 2
+ * encapsulation, any that are supported by YANG should be
+ * listed here.
+ *
+ * Different encapsulations can hook into the common encaps-type
+ * choice statement.
+ */
+ container encapsulation {
+ when
+ "derived-from-or-self(../if:type,
+ 'ianaift:ethernetCsmacd') or
+ derived-from-or-self(../if:type,
+
+ 'ianaift:ieee8023adLag') or
+ derived-from-or-self(../if:type, 'ianaift:pos') or
+ derived-from-or-self(../if:type,
+ 'ianaift:atmSubInterface') or
+ derived-from-or-self(../if:type, 'ethSubInterface')" {
+
+ description
+ "All interface types that can have a configurable L2
+ encapsulation";
+ }
+
+ description
+ "Holds the OSI layer 2 encapsulation associated with an
+ interface";
+ choice encaps-type {
+ description
+ "Extensible choice of layer 2 encapsulations";
+ reference "RFC XXX, Section 3.3 Encapsulation";
+ }
+ }
+
+ /*
+ * Various types of interfaces support loopback configuration,
+ * any that are supported by YANG should be listed here.
+ */
+ leaf loopback {
+ when "derived-from-or-self(../if:type,
+ 'ianaift:ethernetCsmacd') or
+ derived-from-or-self(../if:type, 'ianaift:sonet') or
+ derived-from-or-self(../if:type, 'ianaift:atm') or
+ derived-from-or-self(../if:type, 'ianaift:otnOtu')" {
+ description
+ "All interface types that support loopback configuration.";
+ }
+ if-feature "loopback";
+ type identityref {
+ base loopback;
+ }
+ description "Enables traffic loopback.";
+ reference "RFC XXX, Section 3.4 Loopback";
+ }
+
+ /*
+ * Many types of interfaces support a configurable layer 2 MTU.
+ */
+ leaf l2-mtu {
+ if-feature "configurable-l2-mtu";
+ type uint16 {
+
+ range "64 .. 65535";
+ }
+ description
+ "The maximum size of layer 2 frames that may be transmitted
+ or received on the interface (excluding any FCS overhead).
+ In the case of Ethernet interfaces it also excludes the
+ 4-8 byte overhead of any known (i.e. explicitly matched by
+ a child sub-interface) 802.1Q VLAN tags.";
+ reference "RFC XXX, Section 3.5 Layer 2 MTU";
+ }
+
+ /*
+ * Augments the IETF interfaces model with a leaf that indicates
+ * which mode, or layer, is being used to forward the traffic.
+ */
+ leaf forwarding-mode {
+ if-feature "forwarding-mode";
+ type identityref {
+ base forwarding-mode;
+ }
+
+ description
+ "The forwarding mode that the interface is operating in.";
+ reference "RFC XXX, Section 3.7 Forwarding Mode";
+ }
+ }
+
+ /*
+ * Add generic support for sub-interfaces.
+ *
+ * This should be extended to cover all interface types that are
+ * child interfaces of other interfaces.
+ */
+ augment "/if:interfaces/if:interface" {
+ when "derived-from(if:type, 'sub-interface') or
+ derived-from-or-self(if:type, 'ianaift:atmSubInterface') or
+ derived-from-or-self(if:type, 'ianaift:frameRelay')" {
+ description
+ "Any ianaift:types that explicitly represent sub-interfaces
+ or any types that derive from the sub-interface identity";
+ }
+ if-feature "sub-interfaces";
+
+ description
+ "Add a parent interface field to interfaces that model
+ sub-interfaces";
+ leaf parent-interface {
+
+ type if:interface-ref;
+
+ mandatory true;
+ description
+ "This is the reference to the parent interface of this
+ sub-interface.";
+ reference "RFC XXX, Section 3.6 Sub-interface";
+ }
+ }
+}
\ No newline at end of file
--- /dev/null
+module ietf-key-chain {
+ yang-version 1.1;
+ namespace "urn:ietf:params:xml:ns:yang:ietf-key-chain";
+ prefix key-chain;
+
+ import ietf-yang-types {
+ prefix yang;
+ }
+ import ietf-netconf-acm {
+ prefix nacm;
+ }
+
+ organization
+ "IETF RTGWG - Routing Area Working Group";
+ contact
+ "WG Web: <https://datatracker.ietf.org/group/rtgwg>
+ WG List: <mailto:rtgwg@ietf.org>
+
+ Editor: Acee Lindem
+ <mailto:acee@cisco.com>
+
+ Yingzhen Qu
+ <mailto:yingzhen.qu@huawei.com>
+ Derek Yeung
+ <mailto:derek@arrcus.com>
+ Ing-Wher Chen
+ <mailto:Ing-Wher_Chen@jabail.com>
+ Jeffrey Zhang
+ <mailto:zzhang@juniper.net>";
+
+ description
+ "This YANG module defines the generic configuration
+ data for key chains. It is intended that the module
+ will be extended by vendors to define vendor-specific
+ key chain configuration parameters.
+
+ Copyright (c) 2017 IETF Trust and the persons identified as
+ authors of the code. All rights reserved.
+
+ Redistribution and use in source and binary forms, with or
+ without modification, is permitted pursuant to, and subject
+ to the license terms contained in, the Simplified BSD License
+ set forth in Section 4.c of the IETF Trust's Legal Provisions
+ Relating to IETF Documents
+ (http://trustee.ietf.org/license-info).
+
+ This version of this YANG module is part of RFC 8177;
+ see the RFC itself for full legal notices.";
+
+ reference "RFC 8177";
+
+ revision 2017-06-15 {
+ description
+ "Initial RFC Revision";
+ reference "RFC 8177: YANG Data Model for Key Chains";
+ }
+
+ feature hex-key-string {
+ description
+ "Support hexadecimal key string.";
+ }
+
+ feature accept-tolerance {
+ description
+ "Support the tolerance or acceptance limit.";
+ }
+
+ feature independent-send-accept-lifetime {
+ description
+
+ "Support for independent send and accept key lifetimes.";
+ }
+
+ feature crypto-hmac-sha-1-12 {
+ description
+ "Support for TCP HMAC-SHA-1 12-byte digest hack.";
+ }
+
+ feature cleartext {
+ description
+ "Support for cleartext algorithm. Usage is
+ NOT RECOMMENDED.";
+ }
+
+ feature aes-cmac-prf-128 {
+ description
+ "Support for AES Cipher-based Message Authentication
+ Code Pseudorandom Function.";
+ }
+
+ feature aes-key-wrap {
+ description
+ "Support for Advanced Encryption Standard (AES) Key Wrap.";
+ }
+
+ feature replay-protection-only {
+ description
+ "Provide replay protection without any authentication
+ as required by protocols such as Bidirectional
+ Forwarding Detection (BFD).";
+ }
+ identity crypto-algorithm {
+ description
+ "Base identity of cryptographic algorithm options.";
+ }
+
+ identity hmac-sha-1-12 {
+ base crypto-algorithm;
+ if-feature "crypto-hmac-sha-1-12";
+ description
+ "The HMAC-SHA1-12 algorithm.";
+ }
+
+ identity aes-cmac-prf-128 {
+ base crypto-algorithm;
+ if-feature "aes-cmac-prf-128";
+ description
+ "The AES-CMAC-PRF-128 algorithm - required by
+
+ RFC 5926 for TCP-AO key derivation functions.";
+ }
+
+ identity md5 {
+ base crypto-algorithm;
+ description
+ "The MD5 algorithm.";
+ }
+
+ identity sha-1 {
+ base crypto-algorithm;
+ description
+ "The SHA-1 algorithm.";
+ }
+
+ identity hmac-sha-1 {
+ base crypto-algorithm;
+ description
+ "HMAC-SHA-1 authentication algorithm.";
+ }
+
+ identity hmac-sha-256 {
+ base crypto-algorithm;
+ description
+ "HMAC-SHA-256 authentication algorithm.";
+ }
+
+ identity hmac-sha-384 {
+ base crypto-algorithm;
+ description
+ "HMAC-SHA-384 authentication algorithm.";
+ }
+
+ identity hmac-sha-512 {
+ base crypto-algorithm;
+ description
+ "HMAC-SHA-512 authentication algorithm.";
+ }
+
+ identity cleartext {
+ base crypto-algorithm;
+ if-feature "cleartext";
+ description
+ "cleartext.";
+ }
+
+ identity replay-protection-only {
+ base crypto-algorithm;
+
+ if-feature "replay-protection-only";
+ description
+ "Provide replay protection without any authentication as
+ required by protocols such as Bidirectional Forwarding
+ Detection (BFD).";
+ }
+
+ typedef key-chain-ref {
+ type leafref {
+ path
+ "/key-chain:key-chains/key-chain:key-chain/key-chain:name";
+ }
+ description
+ "This type is used by data models that need to reference
+ configured key chains.";
+ }
+
+ grouping lifetime {
+ description
+ "Key lifetime specification.";
+ choice lifetime {
+ default "always";
+ description
+ "Options for specifying key accept or send lifetimes";
+ case always {
+ leaf always {
+ type empty;
+ description
+ "Indicates key lifetime is always valid.";
+ }
+ }
+ case start-end-time {
+ leaf start-date-time {
+ type yang:date-and-time;
+ description
+ "Start time.";
+ }
+ choice end-time {
+ default "infinite";
+ description
+ "End-time setting.";
+ case infinite {
+ leaf no-end-time {
+ type empty;
+ description
+ "Indicates key lifetime end-time is infinite.";
+ }
+ }
+
+ case duration {
+ leaf duration {
+ type uint32 {
+ range "1..2147483646";
+ }
+ units "seconds";
+ description
+ "Key lifetime duration, in seconds";
+ }
+ }
+ case end-date-time {
+ leaf end-date-time {
+ type yang:date-and-time;
+ description
+ "End time.";
+ }
+ }
+ }
+ }
+ }
+ }
+
+ container key-chains {
+ description
+ "All configured key-chains on the device.";
+ list key-chain {
+ key "name";
+ description
+ "List of key-chains.";
+ leaf name {
+ type string;
+ description
+ "Name of the key-chain.";
+ }
+ leaf description {
+ type string;
+ description
+ "A description of the key-chain";
+ }
+ container accept-tolerance {
+ if-feature "accept-tolerance";
+ description
+ "Tolerance for key lifetime acceptance (seconds).";
+ leaf duration {
+ type uint32;
+ units "seconds";
+ default "0";
+ description
+
+ "Tolerance range, in seconds.";
+ }
+ }
+ leaf last-modified-timestamp {
+ type yang:date-and-time;
+ config false;
+ description
+ "Timestamp of the most recent update to the key-chain";
+ }
+ list key {
+ key "key-id";
+ description
+ "Single key in key chain.";
+ leaf key-id {
+ type uint64;
+ description
+ "Numeric value uniquely identifying the key";
+ }
+ container lifetime {
+ description
+ "Specify a key's lifetime.";
+ choice lifetime {
+ description
+ "Options for specification of send and accept
+ lifetimes.";
+ case send-and-accept-lifetime {
+ description
+ "Send and accept key have the same lifetime.";
+ container send-accept-lifetime {
+ description
+ "Single lifetime specification for both
+ send and accept lifetimes.";
+ uses lifetime;
+ }
+ }
+ case independent-send-accept-lifetime {
+ if-feature "independent-send-accept-lifetime";
+ description
+ "Independent send and accept key lifetimes.";
+ container send-lifetime {
+ description
+ "Separate lifetime specification for send
+ lifetime.";
+ uses lifetime;
+ }
+ container accept-lifetime {
+ description
+ "Separate lifetime specification for accept
+
+ lifetime.";
+ uses lifetime;
+ }
+ }
+ }
+ }
+ leaf crypto-algorithm {
+ type identityref {
+ base crypto-algorithm;
+ }
+ mandatory true;
+ description
+ "Cryptographic algorithm associated with key.";
+ }
+ container key-string {
+ description
+ "The key string.";
+ nacm:default-deny-all;
+ choice key-string-style {
+ description
+ "Key string styles";
+ case keystring {
+ leaf keystring {
+ type string;
+ description
+ "Key string in ASCII format.";
+ }
+ }
+ case hexadecimal {
+ if-feature "hex-key-string";
+ leaf hexadecimal-string {
+ type yang:hex-string;
+ description
+ "Key in hexadecimal string format. When compared
+ to ASCII, specification in hexadecimal affords
+ greater key entropy with the same number of
+ internal key-string octets. Additionally, it
+ discourages usage of well-known words or
+ numbers.";
+ }
+ }
+ }
+ }
+ leaf send-lifetime-active {
+ type boolean;
+ config false;
+ description
+ "Indicates if the send lifetime of the
+
+ key-chain key is currently active.";
+ }
+ leaf accept-lifetime-active {
+ type boolean;
+ config false;
+ description
+ "Indicates if the accept lifetime of the
+ key-chain key is currently active.";
+ }
+ }
+ }
+ container aes-key-wrap {
+ if-feature "aes-key-wrap";
+ description
+ "AES Key Wrap encryption for key-chain key-strings. The
+ encrypted key-strings are encoded as hexadecimal key
+ strings using the hex-key-string leaf.";
+ leaf enable {
+ type boolean;
+ default "false";
+ description
+ "Enable AES Key Wrap encryption.";
+ }
+ }
+ }
+}
--- /dev/null
+module ietf-netconf-acm {
+
+ namespace "urn:ietf:params:xml:ns:yang:ietf-netconf-acm";
+
+ prefix nacm;
+
+ import ietf-yang-types {
+ prefix yang;
+ }
+
+ organization
+ "IETF NETCONF (Network Configuration) Working Group";
+
+ contact
+ "WG Web: <https://datatracker.ietf.org/wg/netconf/>
+ WG List: <mailto:netconf@ietf.org>
+
+ Author: Andy Bierman
+ <mailto:andy@yumaworks.com>
+
+ Author: Martin Bjorklund
+ <mailto:mbj@tail-f.com>";
+
+ description
+ "Network Configuration Access Control Model.
+
+ Copyright (c) 2012 - 2018 IETF Trust and the persons
+ identified as authors of the code. All rights reserved.
+
+ Redistribution and use in source and binary forms, with or
+ without modification, is permitted pursuant to, and subject
+ to the license terms contained in, the Simplified BSD
+ License set forth in Section 4.c of the IETF Trust's
+ Legal Provisions Relating to IETF Documents
+ (https://trustee.ietf.org/license-info).
+
+ This version of this YANG module is part of RFC 8341; see
+ the RFC itself for full legal notices.";
+
+ revision "2018-02-14" {
+ description
+ "Added support for YANG 1.1 actions and notifications tied to
+ data nodes. Clarified how NACM extensions can be used by
+ other data models.";
+ reference
+ "RFC 8341: Network Configuration Access Control Model";
+ }
+
+ revision "2012-02-22" {
+ description
+ "Initial version.";
+ reference
+ "RFC 6536: Network Configuration Protocol (NETCONF)
+ Access Control Model";
+ }
+
+ /*
+ * Extension statements
+ */
+
+ extension default-deny-write {
+ description
+ "Used to indicate that the data model node
+ represents a sensitive security system parameter.
+
+ If present, the NETCONF server will only allow the designated
+ 'recovery session' to have write access to the node. An
+ explicit access control rule is required for all other users.
+
+ If the NACM module is used, then it must be enabled (i.e.,
+ /nacm/enable-nacm object equals 'true'), or this extension
+ is ignored.
+
+ The 'default-deny-write' extension MAY appear within a data
+ definition statement. It is ignored otherwise.";
+ }
+
+ extension default-deny-all {
+ description
+ "Used to indicate that the data model node
+ controls a very sensitive security system parameter.
+
+ If present, the NETCONF server will only allow the designated
+ 'recovery session' to have read, write, or execute access to
+ the node. An explicit access control rule is required for all
+ other users.
+
+ If the NACM module is used, then it must be enabled (i.e.,
+ /nacm/enable-nacm object equals 'true'), or this extension
+ is ignored.
+
+ The 'default-deny-all' extension MAY appear within a data
+ definition statement, 'rpc' statement, or 'notification'
+ statement. It is ignored otherwise.";
+ }
+
+ /*
+ * Derived types
+ */
+
+ typedef user-name-type {
+ type string {
+ length "1..max";
+ }
+ description
+ "General-purpose username string.";
+ }
+
+ typedef matchall-string-type {
+ type string {
+ pattern '\*';
+ }
+ description
+ "The string containing a single asterisk '*' is used
+ to conceptually represent all possible values
+ for the particular leaf using this data type.";
+ }
+
+ typedef access-operations-type {
+ type bits {
+ bit create {
+ description
+ "Any protocol operation that creates a
+ new data node.";
+ }
+ bit read {
+ description
+ "Any protocol operation or notification that
+ returns the value of a data node.";
+ }
+ bit update {
+ description
+ "Any protocol operation that alters an existing
+ data node.";
+ }
+
+ bit delete {
+ description
+ "Any protocol operation that removes a data node.";
+ }
+ bit exec {
+ description
+ "Execution access to the specified protocol operation.";
+ }
+ }
+ description
+ "Access operation.";
+ }
+
+ typedef group-name-type {
+ type string {
+ length "1..max";
+ pattern '[^\*].*';
+ }
+ description
+ "Name of administrative group to which
+ users can be assigned.";
+ }
+
+ typedef action-type {
+ type enumeration {
+ enum permit {
+ description
+ "Requested action is permitted.";
+ }
+ enum deny {
+ description
+ "Requested action is denied.";
+ }
+ }
+ description
+ "Action taken by the server when a particular
+ rule matches.";
+ }
+
+ typedef node-instance-identifier {
+ type yang:xpath1.0;
+ description
+ "Path expression used to represent a special
+ data node, action, or notification instance-identifier
+ string.
+
+ A node-instance-identifier value is an
+ unrestricted YANG instance-identifier expression.
+
+ All the same rules as an instance-identifier apply,
+ except that predicates for keys are optional. If a key
+ predicate is missing, then the node-instance-identifier
+ represents all possible server instances for that key.
+
+ This XML Path Language (XPath) expression is evaluated in the
+ following context:
+
+ o The set of namespace declarations are those in scope on
+ the leaf element where this type is used.
+
+ o The set of variable bindings contains one variable,
+ 'USER', which contains the name of the user of the
+ current session.
+
+ o The function library is the core function library, but
+ note that due to the syntax restrictions of an
+ instance-identifier, no functions are allowed.
+
+ o The context node is the root node in the data tree.
+
+ The accessible tree includes actions and notifications tied
+ to data nodes.";
+ }
+
+ /*
+ * Data definition statements
+ */
+
+ container nacm {
+ nacm:default-deny-all;
+
+ description
+ "Parameters for NETCONF access control model.";
+
+ leaf enable-nacm {
+ type boolean;
+ default "true";
+ description
+ "Enables or disables all NETCONF access control
+ enforcement. If 'true', then enforcement
+ is enabled. If 'false', then enforcement
+ is disabled.";
+ }
+
+ leaf read-default {
+ type action-type;
+ default "permit";
+ description
+ "Controls whether read access is granted if
+ no appropriate rule is found for a
+ particular read request.";
+ }
+
+ leaf write-default {
+ type action-type;
+ default "deny";
+ description
+ "Controls whether create, update, or delete access
+ is granted if no appropriate rule is found for a
+ particular write request.";
+ }
+
+ leaf exec-default {
+ type action-type;
+ default "permit";
+ description
+ "Controls whether exec access is granted if no appropriate
+ rule is found for a particular protocol operation request.";
+ }
+
+ leaf enable-external-groups {
+ type boolean;
+ default "true";
+ description
+ "Controls whether the server uses the groups reported by the
+ NETCONF transport layer when it assigns the user to a set of
+ NACM groups. If this leaf has the value 'false', any group
+ names reported by the transport layer are ignored by the
+ server.";
+ }
+
+ leaf denied-operations {
+ type yang:zero-based-counter32;
+ config false;
+ mandatory true;
+ description
+ "Number of times since the server last restarted that a
+ protocol operation request was denied.";
+ }
+
+ leaf denied-data-writes {
+ type yang:zero-based-counter32;
+ config false;
+ mandatory true;
+ description
+ "Number of times since the server last restarted that a
+ protocol operation request to alter
+ a configuration datastore was denied.";
+ }
+
+ leaf denied-notifications {
+ type yang:zero-based-counter32;
+ config false;
+ mandatory true;
+ description
+ "Number of times since the server last restarted that
+ a notification was dropped for a subscription because
+ access to the event type was denied.";
+ }
+
+ container groups {
+ description
+ "NETCONF access control groups.";
+
+ list group {
+ key name;
+
+ description
+ "One NACM group entry. This list will only contain
+ configured entries, not any entries learned from
+ any transport protocols.";
+
+ leaf name {
+ type group-name-type;
+ description
+ "Group name associated with this entry.";
+ }
+
+ leaf-list user-name {
+ type user-name-type;
+ description
+ "Each entry identifies the username of
+ a member of the group associated with
+ this entry.";
+ }
+ }
+ }
+
+ list rule-list {
+ key name;
+ ordered-by user;
+ description
+ "An ordered collection of access control rules.";
+
+ leaf name {
+ type string {
+ length "1..max";
+ }
+ description
+ "Arbitrary name assigned to the rule-list.";
+ }
+ leaf-list group {
+ type union {
+ type matchall-string-type;
+ type group-name-type;
+ }
+ description
+ "List of administrative groups that will be
+ assigned the associated access rights
+ defined by the 'rule' list.
+
+ The string '*' indicates that all groups apply to the
+ entry.";
+ }
+
+ list rule {
+ key name;
+ ordered-by user;
+ description
+ "One access control rule.
+
+ Rules are processed in user-defined order until a match is
+ found. A rule matches if 'module-name', 'rule-type', and
+ 'access-operations' match the request. If a rule
+ matches, the 'action' leaf determines whether or not
+ access is granted.";
+
+ leaf name {
+ type string {
+ length "1..max";
+ }
+ description
+ "Arbitrary name assigned to the rule.";
+ }
+
+ leaf module-name {
+ type union {
+ type matchall-string-type;
+ type string;
+ }
+ default "*";
+ description
+ "Name of the module associated with this rule.
+
+ This leaf matches if it has the value '*' or if the
+ object being accessed is defined in the module with the
+ specified module name.";
+ }
+ choice rule-type {
+ description
+ "This choice matches if all leafs present in the rule
+ match the request. If no leafs are present, the
+ choice matches all requests.";
+ case protocol-operation {
+ leaf rpc-name {
+ type union {
+ type matchall-string-type;
+ type string;
+ }
+ description
+ "This leaf matches if it has the value '*' or if
+ its value equals the requested protocol operation
+ name.";
+ }
+ }
+ case notification {
+ leaf notification-name {
+ type union {
+ type matchall-string-type;
+ type string;
+ }
+ description
+ "This leaf matches if it has the value '*' or if its
+ value equals the requested notification name.";
+ }
+ }
+
+ case data-node {
+ leaf path {
+ type node-instance-identifier;
+ mandatory true;
+ description
+ "Data node instance-identifier associated with the
+ data node, action, or notification controlled by
+ this rule.
+
+ Configuration data or state data
+ instance-identifiers start with a top-level
+ data node. A complete instance-identifier is
+ required for this type of path value.
+
+ The special value '/' refers to all possible
+ datastore contents.";
+ }
+ }
+ }
+
+ leaf access-operations {
+ type union {
+ type matchall-string-type;
+ type access-operations-type;
+ }
+ default "*";
+ description
+ "Access operations associated with this rule.
+
+ This leaf matches if it has the value '*' or if the
+ bit corresponding to the requested operation is set.";
+ }
+
+ leaf action {
+ type action-type;
+ mandatory true;
+ description
+ "The access control action associated with the
+ rule. If a rule has been determined to match a
+ particular request, then this object is used
+ to determine whether to permit or deny the
+ request.";
+ }
+
+ leaf comment {
+ type string;
+ description
+ "A textual description of the access rule.";
+ }
+ }
+ }
+ }
+}
+
--- /dev/null
+module ietf-routing-policy {
+
+ yang-version "1.1";
+ namespace "urn:ietf:params:xml:ns:yang:ietf-routing-policy";
+ prefix rt-pol;
+
+ import ietf-inet-types {
+ prefix "inet";
+ }
+
+ import ietf-yang-types {
+ prefix "yang";
+ }
+
+ import ietf-interfaces {
+ prefix "if";
+ }
+
+ import ietf-routing {
+ prefix "rt";
+ }
+
+ import ietf-interfaces-common {
+ prefix if-cmn;
+ }
+
+ import ietf-if-l3-vlan {
+ prefix "if-l3-vlan";
+ }
+
+
+ organization
+ "IETF RTGWG - Routing Area Working Group";
+ contact
+ "WG Web: <http://tools.ietf.org/wg/rtgwg/>
+ WG List: <mailto:rtgwg@ietf.org>
+
+
+ Editor: Yingzhen Qu
+ <mailto:yingzhen.qu@huawei.com>
+
+ Jeff Tantsura
+ <mailto:jefftant.ietf@gmail.com>
+ Acee Lindem
+ <mailto:acee@cisco.com>
+ Xufeng Liu
+ <mailto:xufeng_liu@jabil.com>
+ Anees Shaikh
+ <mailto:aashaikh@google.com>";
+
+ description
+ "This module describes a YANG model for routing policy
+ configuration. It is a limited subset of all of the policy
+ configuration parameters available in the variety of vendor
+ implementations, but supports widely used constructs for
+ managing how routes are imported, exported, and modified across
+ different routing protocols. This module is intended to be
+ used in conjunction with routing protocol configuration modules
+ (e.g., BGP) defined in other models.
+
+ Route policy expression:
+
+ Policies are expressed as a set of top-level policy
+ definitions, each of which consists of a sequence of policy
+ statements. Policy statements consist of simple
+ condition-action tuples. Conditions may include mutiple match
+ or comparison operations, and similarly actions may be
+ multitude of changes to route attributes or a final disposition
+ of accepting or rejecting the route.
+
+ Route policy evaluation:
+
+ Policy definitions are referenced in routing protocol
+ configurations using import and export configuration
+ statements. The arguments are members of an ordered list of
+ named policy definitions which comprise a policy chain, and
+ optionally, an explicit default policy action (i.e., reject
+ or accept).
+
+ Evaluation of each policy definition proceeds by evaluating its
+ corresponding individual policy statements in order. When a
+ condition statement in a policy statement is satisfied, the
+ corresponding action statement is executed. If the action
+ statement has either accept-route or reject-route actions,
+ policy evaluation of the current policy definition stops, and
+ no further policy definitions in the chain are evaluated.
+
+ If the condition is not satisfied, then evaluation proceeds to
+ the next policy statement. If none of the policy statement
+
+ conditions are satisfied, then evaluation of the current policy
+ definition stops, and the next policy definition in the chain
+ is evaluated. When the end of the policy chain is reached, the
+ default route disposition action is performed (i.e.,
+ reject-route unless an alternate default action is specified
+ for the chain).
+
+ Policy 'subroutines' (or nested policies) are supported by
+ allowing policy statement conditions to reference another
+ policy definition which applies conditions and actions from
+ the referenced policy before returning to the calling policy
+ statement and resuming evaluation. If the called policy
+ results in an accept-route (either explicit or by default),
+ then the subroutine returns an effective true value to the
+ calling policy. Similarly, a reject-route action returns
+ false. If the subroutine returns true, the calling policy
+ continues to evaluate the remaining conditions (using a
+ modified route if the subroutine performed any changes to the
+ route).";
+
+
+ revision "2019-03-06" {
+ description
+ "Initial revision.";
+ reference
+ "RFC XXXX: Routing Policy Configuration Model for Service
+ Provider Networks";
+ }
+
+
+ // typedef statements
+
+ typedef default-policy-type {
+ // this typedef retained for name compatibiity with default
+ // import and export policy
+ type enumeration {
+ enum accept-route {
+ description
+ "Default policy to accept the route";
+ }
+ enum reject-route {
+ description
+ "Default policy to reject the route";
+ }
+ }
+ description
+ "Type used to specify route disposition in
+ a policy chain";
+
+ }
+
+ typedef policy-result-type {
+ type enumeration {
+ enum accept-route {
+ description "Policy accepts the route";
+ }
+ enum reject-route {
+ description "Policy rejects the route";
+ }
+ }
+ description
+ "Type used to specify route disposition in
+ a policy chain";
+ }
+
+ typedef tag-type {
+ type union {
+ type uint32;
+ type yang:hex-string;
+ }
+ description "Type for expressing route tags on a local system,
+ including IS-IS and OSPF; may be expressed as either decimal
+ or hexadecimal integer";
+ reference
+ "RFC 2178 - OSPF Version 2
+ RFC 5130 - A Policy Control Mechanism in IS-IS Using
+ Administrative Tags";
+ }
+
+ typedef match-set-options-type {
+ type enumeration {
+ enum any {
+ description "Match is true if given value matches any member
+ of the defined set";
+ }
+ enum all {
+ description "Match is true if given value matches all
+ members of the defined set";
+ }
+ enum invert {
+ description "Match is true if given value does not match any
+ member of the defined set";
+ }
+ }
+ default any;
+ description
+ "Options that govern the behavior of a match statement. The
+
+ default behavior is any, i.e., the given value matches any
+ of the members of the defined set";
+ }
+
+
+ // grouping statements
+
+ grouping prefix-set {
+ description
+ "Configuration data for prefix sets used in policy
+ definitions.";
+
+ leaf name {
+ type string;
+ description
+ "Name of the prefix set -- this is used as a label to
+ reference the set in match conditions";
+ }
+
+ leaf mode {
+ type enumeration {
+ enum ipv4 {
+ description
+ "Prefix set contains IPv4 prefixes only";
+ }
+ enum ipv6 {
+ description
+ "Prefix set contains IPv6 prefixes only";
+ }
+ enum mixed {
+ description
+ "Prefix set contains mixed IPv4 and IPv6 prefixes";
+ }
+ }
+ description
+ "Indicates the mode of the prefix set, in terms of which
+ address families (IPv4, IPv6, or both) are present. The
+ mode provides a hint, but the device must validate that all
+ prefixes are of the indicated type, and is expected to
+ reject the configuration if there is a discrepancy. The
+ MIXED mode may not be supported on devices that require
+ prefix sets to be of only one address family.";
+ }
+
+ }
+
+ grouping prefix-set-top {
+ description
+
+ "Top-level data definitions for a list of IPv4 or IPv6
+ prefixes which are matched as part of a policy";
+
+ container prefix-sets {
+ description
+ "Enclosing container ";
+
+ list prefix-set {
+ key "name";
+ description
+ "List of the defined prefix sets";
+
+ uses prefix-set;
+
+ uses prefix-top;
+ }
+ }
+ }
+
+ grouping prefix {
+ description
+ "Configuration data for a prefix definition";
+
+ leaf ip-prefix {
+ type inet:ip-prefix;
+ mandatory true;
+ description
+ "The prefix member in CIDR notation -- while the
+ prefix may be either IPv4 or IPv6, most
+ implementations require all members of the prefix set
+ to be the same address family. Mixing address types in
+ the same prefix set is likely to cause an error.";
+ }
+
+ leaf masklength-lower {
+ type uint8;
+ description
+ "Masklength range lower bound.";
+ }
+ leaf masklength-upper {
+ type uint8 {
+ range "1..128";
+ }
+ must "../masklength-upper >= ../masklength-lower" {
+ error-message "The upper bound should not be less"
+ + "than lower bound.";
+ }
+ description
+
+ "Masklength range upper bound.
+
+ The combination of masklength-lower and masklength-upper
+ define a range for the mask length, or single 'exact'
+ length if masklength-lower and masklenght-upper are equal.
+
+ Example: 10.3.192.0/21 through 10.3.192.0/24 would be
+ expressed as prefix: 10.3.192.0/21,
+ masklength-lower=21,
+ masklength-upper=24
+
+ Example: 10.3.192.0/21 (an exact match) would be
+ expressed as prefix: 10.3.192.0/21,
+ masklength-lower=21,
+ masklength-upper=21";
+ }
+ }
+
+ grouping prefix-top {
+ description
+ "Top-level grouping for prefixes in a prefix list";
+
+ container prefixes {
+ description
+ "Enclosing container for the list of prefixes in a policy
+ prefix list";
+
+ list prefix-list {
+ key "ip-prefix masklength-lower masklength-upper";
+ description
+ "List of prefixes in the prefix set";
+
+ uses prefix;
+ }
+ }
+ }
+
+ grouping neighbor-set {
+ description
+ "This grouping provides neighbor set definitions";
+
+ leaf name {
+ type string;
+ description
+ "Name of the neighbor set -- this is used as a label
+ to reference the set in match conditions";
+ }
+
+ leaf-list address {
+ type inet:ip-address;
+ description
+ "List of IP addresses in the neighbor set";
+ }
+ }
+
+ grouping neighbor-set-top {
+ description
+ "Top-level data definition for a list of IPv4 or IPv6
+ neighbors which can be matched in a routing policy";
+
+ container neighbor-sets {
+ description
+ "Enclosing container for the list of neighbor set
+ definitions";
+
+ list neighbor-set {
+ key "name";
+ description
+ "List of defined neighbor sets for use in policies.";
+
+ uses neighbor-set;
+ }
+ }
+ }
+
+ grouping tag-set {
+ description
+ "This grouping provides tag set definitions.";
+
+ leaf name {
+ type string;
+ description
+ "Name of the tag set -- this is used as a label to reference
+ the set in match conditions";
+ }
+
+ leaf-list tag-value {
+ type tag-type;
+ description
+ "Value of the tag set member";
+ }
+ }
+
+ grouping tag-set-top {
+ description
+ "Top-level data definitions for a list of tags which can
+
+ be matched in policies";
+
+ container tag-sets {
+ description
+ "Enclosing container for the list of tag sets.";
+
+ list tag-set {
+ key "name";
+ description
+ "List of tag set definitions.";
+
+ uses tag-set;
+
+ }
+ }
+ }
+
+
+ grouping match-set-options-group {
+ description
+ "Grouping containing options relating to how a particular set
+ should be matched";
+
+ leaf match-set-options {
+ type match-set-options-type;
+ description
+ "Optional parameter that governs the behavior of the
+ match operation";
+ }
+ }
+
+ grouping match-set-options-restricted-group {
+ description
+ "Grouping for a restricted set of match operation modifiers";
+
+ leaf match-set-options {
+ type match-set-options-type {
+ enum any {
+ description "Match is true if given value matches any
+ member of the defined set";
+ }
+ enum invert {
+ description "Match is true if given value does not match
+ any member of the defined set";
+ }
+ }
+ description
+ "Optional parameter that governs the behavior of the
+
+ match operation. This leaf only supports matching on ANY
+ member of the set or inverting the match. Matching on ALL
+ is not supported";
+ }
+ }
+
+
+
+ grouping match-interface-condition {
+ description
+ "This grouping provides interface match condition";
+
+ container match-interface {
+ leaf interface {
+ type leafref {
+ path "/if:interfaces/if:interface/if:name";
+ }
+ description
+ "Reference to a base interface. If a reference to a
+ subinterface is required, this leaf must be specified
+ to indicate the base interface.";
+ }
+ leaf subinterface {
+ type leafref {
+ path "/if:interfaces/if:interface/if-cmn:encapsulation"
+ + "/if-l3-vlan:dot1q-vlan"
+ + "/if-l3-vlan:outer-tag/if-l3-vlan:vlan-id";
+ }
+ description
+ "Reference to a subinterface -- this requires the base
+ interface to be specified using the interface leaf in
+ this container. If only a reference to a base interface
+ is requuired, this leaf should not be set.";
+ }
+
+ description
+ "Container for interface match conditions";
+ }
+ }
+
+ grouping prefix-set-condition {
+ description
+ "This grouping provides prefix-set conditions";
+
+ container match-prefix-set {
+ leaf prefix-set {
+ type leafref {
+ path "../../../../../../../defined-sets/" +
+
+ "prefix-sets/prefix-set/name";
+ }
+ description "References a defined prefix set";
+ }
+ uses match-set-options-restricted-group;
+
+ description
+ "Match a referenced prefix-set according to the logic
+ defined in the match-set-options leaf";
+ }
+ }
+
+ grouping neighbor-set-condition {
+ description
+ "This grouping provides neighbor-set conditions";
+
+ container match-neighbor-set {
+ leaf neighbor-set {
+ type leafref {
+ path "../../../../../../../defined-sets/neighbor-sets/" +
+ "neighbor-set/name";
+ require-instance true;
+ }
+ description "References a defined neighbor set";
+ }
+
+ description
+ "Match a referenced neighbor set according to the logic
+ defined in the match-set-options-leaf";
+ }
+ }
+
+ grouping tag-set-condition {
+ description
+ "This grouping provides tag-set conditions";
+
+ container match-tag-set {
+ leaf tag-set {
+ type leafref {
+ path "../../../../../../../defined-sets/tag-sets" +
+ "/tag-set/name";
+ require-instance true;
+ }
+ description "References a defined tag set";
+ }
+ uses match-set-options-restricted-group;
+
+ description
+
+ "Match a referenced tag set according to the logic defined
+ in the match-options-set leaf";
+ }
+ }
+
+ grouping generic-conditions {
+ description "Condition statement definitions for checking
+ membership in a generic defined set";
+
+ uses match-interface-condition;
+ uses prefix-set-condition;
+ uses neighbor-set-condition;
+ uses tag-set-condition;
+
+ }
+
+ grouping policy-conditions {
+ description
+ "Data for general policy conditions, i.e., those
+ not related to match-sets";
+
+ leaf call-policy {
+ type leafref {
+ path "../../../../../../" +
+ "rt-pol:policy-definitions/" +
+ "rt-pol:policy-definition/rt-pol:name";
+ require-instance true;
+ }
+ description
+ "Applies the statements from the specified policy
+ definition and then returns control the current
+ policy statement. Note that the called policy may
+ itself call other policies (subject to
+ implementation limitations). This is intended to
+ provide a policy 'subroutine' capability. The
+ called policy should contain an explicit or a
+ default route disposition that returns an
+ effective true (accept-route) or false
+ (reject-route), otherwise the behavior may be
+ ambiguous and implementation dependent";
+ }
+
+ leaf source-protocol {
+ type identityref {
+ base rt:control-plane-protocol;
+ }
+ description
+ "Condition to check the protocol / method used to install
+
+ the route into the local routing table";
+ }
+ }
+
+ grouping policy-conditions-top {
+ description
+ "Top-level grouping for policy conditions";
+
+ container conditions {
+ description
+ "Condition statements for the current policy statement";
+
+ uses policy-conditions;
+
+ uses generic-conditions;
+ }
+ }
+
+ grouping policy-statements {
+ description
+ "Data for policy statements";
+
+ leaf name {
+ type string;
+ description
+ "Name of the policy statement";
+ }
+ }
+
+
+ grouping policy-actions {
+ description
+ "Top-level grouping for policy actions";
+
+ container actions {
+ description
+ "Top-level container for policy action statements";
+
+ leaf policy-result {
+ type policy-result-type;
+ description
+ "Select the final disposition for the route, either
+ accept or reject.";
+ }
+ leaf set-metric {
+ type uint32;
+ description
+ "Set a new metric for the route.";
+
+ }
+ leaf set-preference {
+ type uint16;
+ description
+ "Set a new preference for the route.";
+ }
+ }
+ }
+
+ grouping policy-statements-top {
+ description
+ "Top-level grouping for the policy statements list";
+
+ container statements {
+ description
+ "Enclosing container for policy statements";
+
+ list statement {
+ key "name";
+ ordered-by user;
+ description
+ "Policy statements group conditions and actions
+ within a policy definition. They are evaluated in
+ the order specified (see the description of policy
+ evaluation at the top of this module.";
+
+ uses policy-statements;
+
+ uses policy-conditions-top;
+ uses policy-actions;
+ }
+ }
+ }
+
+
+ grouping policy-definitions {
+ description
+ "This grouping provides policy definitions";
+
+ leaf name {
+ type string;
+ description
+ "Name of the top-level policy definition -- this name
+ is used in references to the current policy";
+ }
+ }
+
+ grouping apply-policy-import {
+
+ description
+ "Grouping for applying import policies";
+
+ leaf-list import-policy {
+ type leafref {
+ path "/rt-pol:routing-policy/rt-pol:policy-definitions/" +
+ "rt-pol:policy-definition/rt-pol:name";
+ require-instance true;
+ }
+ ordered-by user;
+ description
+ "List of policy names in sequence to be applied on
+ receiving a routing update in the current context, e.g.,
+ for the current peer group, neighbor, address family,
+ etc.";
+ }
+
+ leaf default-import-policy {
+ type default-policy-type;
+ default reject-route;
+ description
+ "Explicitly set a default policy if no policy definition
+ in the import policy chain is satisfied.";
+ }
+
+ }
+
+ grouping apply-policy-export {
+ description
+ "Grouping for applying export policies";
+
+ leaf-list export-policy {
+ type leafref {
+ path "/rt-pol:routing-policy/rt-pol:policy-definitions/" +
+ "rt-pol:policy-definition/rt-pol:name";
+ require-instance true;
+ }
+ ordered-by user;
+ description
+ "List of policy names in sequence to be applied on
+ sending a routing update in the current context, e.g.,
+ for the current peer group, neighbor, address family,
+ etc.";
+ }
+
+ leaf default-export-policy {
+ type default-policy-type;
+ default reject-route;
+
+ description
+ "Explicitly set a default policy if no policy definition
+ in the export policy chain is satisfied.";
+ }
+ }
+
+
+ grouping apply-policy {
+ description
+ "Configuration data for routing policies";
+
+ uses apply-policy-import;
+ uses apply-policy-export;
+
+ container apply-policy-state {
+ description
+ "Operational state associated with routing policy";
+
+ //TODO: identify additional state data beyond the intended
+ //policy configuration.
+ }
+
+ }
+
+
+ grouping apply-policy-group {
+ description
+ "Top level container for routing policy applications. This
+ grouping is intended to be used in routing models where
+ needed.";
+
+ container apply-policy {
+ description
+ "Anchor point for routing policies in the model.
+ Import and export policies are with respect to the local
+ routing table, i.e., export (send) and import (receive),
+ depending on the context.";
+
+ uses apply-policy;
+
+ }
+ }
+
+ container routing-policy {
+ description
+ "Top-level container for all routing policy";
+
+ container defined-sets {
+
+ description
+ "Predefined sets of attributes used in policy match
+ statements";
+
+ uses prefix-set-top;
+ uses neighbor-set-top;
+ uses tag-set-top;
+ }
+
+ container policy-definitions {
+ description
+ "Enclosing container for the list of top-level policy
+ definitions";
+
+ list policy-definition {
+ key "name";
+ description
+ "List of top-level policy definitions, keyed by unique
+ name. These policy definitions are expected to be
+ referenced (by name) in policy chains specified in import
+ or export configuration statements.";
+
+ uses policy-definitions;
+
+ uses policy-statements-top;
+ }
+ }
+ }
+}
<type>xml</type>
<classifier>features</classifier>
</dependency>
+ <dependency>
+ <groupId>org.opendaylight.unimgr</groupId>
+ <artifactId>bgp-api</artifactId>
+ <version>${project.version}</version>
+ </dependency>
</dependencies>
<build>
<plugins>
<modules>
<module>legato-api</module>
<module>nrp-api</module>
+ <module>bgp-api</module>
<module>impl</module>
<module>cisco-xr-driver</module>
<module>ovs-driver</module>