Trying out bgp-api with apidoc explorer
[unimgr.git] / bgp-api / src / main / yang / ietf-bgp-common@2019-06-13.yang
diff --git a/bgp-api/src/main/yang/ietf-bgp-common@2019-06-13.yang b/bgp-api/src/main/yang/ietf-bgp-common@2019-06-13.yang
new file mode 100644 (file)
index 0000000..951e4e4
--- /dev/null
@@ -0,0 +1,458 @@
+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";
+    }
+  }
+}