--- /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";
+ }
+ }
+}