Adding OpenConfig YANG models.
Change-Id: I0a2fdd5826e80933cf4b9ae939ff3051acec02aa
diff --git a/models/openconfig/src/main/yang/aft/openconfig-aft-common.yang b/models/openconfig/src/main/yang/aft/openconfig-aft-common.yang
new file mode 100644
index 0000000..b740369
--- /dev/null
+++ b/models/openconfig/src/main/yang/aft/openconfig-aft-common.yang
@@ -0,0 +1,222 @@
+submodule openconfig-aft-common {
+ belongs-to "openconfig-aft" {
+ prefix "oc-aft";
+ }
+
+ import openconfig-interfaces { prefix "oc-if"; }
+ import openconfig-extensions { prefix "oc-ext"; }
+ import openconfig-yang-types { prefix "oc-yang"; }
+ import openconfig-inet-types { prefix "oc-inet"; }
+ import openconfig-mpls-types { prefix "oc-mplst"; }
+ import openconfig-policy-types { prefix "oc-pol-types"; }
+ import openconfig-aft-types { prefix "oc-aftt"; }
+
+ oc-ext:openconfig-version "0.3.0";
+
+ organization
+ "OpenConfig working group";
+
+ contact
+ "OpenConfig working group
+ www.openconfig.net";
+
+ description
+ "Submodule containing definitions of groupings that are re-used
+ across multiple contexts within the AFT model.";
+
+ revision 2017-05-10 {
+ description
+ "Refactor to provide concretised per-AF schemas per AFT.";
+ reference "0.3.0";
+ }
+
+ grouping aft-common-nhop-structural {
+ description
+ "Structural grouping describing a next-hop entry.";
+
+ container next-hops {
+ description
+ "The list of next-hops that are to be used for entry within
+ the AFT table. The structure of each next-hop is address
+ family independent, such that it is possible to resolve fully
+ how the next-hop is treated. For example:
+
+ - Where ingress IPv4 unicast packets are to be forwarded via
+ an MPLS LSP, the next-hop list should indicate the MPLS
+ label stack that is used to the next-hop.
+ - Where ingress MPLS labelled packets are to be forwarded to
+ an IPv6 nexthop (for example, a CE within a VPN, then the
+ popped label stack, and IPv6 next-hop address should be
+ indicated).";
+
+ list next-hop {
+ key "index";
+
+ description
+ "A next-hop associated with the forwarding instance. The
+ entries within the next-hop list should only reflect
+ next-hops that are actively used by the local system.
+ That is to say inactive, backup or FRR next-hops should
+ not be included within this list.";
+
+ leaf index {
+ type leafref {
+ path "../config/index";
+ }
+ description
+ "A unique index identifying the next-hop entry for the
+ AFT entry";
+
+ }
+
+ container config {
+ description
+ "Configuration parameters relating to the AFT next-hop
+ entry";
+
+ uses aft-common-entry-nexthop-config;
+ }
+
+ container state {
+ config false;
+ description
+ "Operational state parameters relating to the AFT
+ next-hop entry";
+
+ uses aft-common-entry-nexthop-config;
+ uses aft-common-entry-nexthop-state;
+ }
+
+ uses oc-if:interface-ref;
+ }
+ }
+ }
+
+ grouping aft-common-entry-state {
+ description
+ "Operational state parameters relating to a forwarding entry";
+
+ leaf packets-forwarded {
+ type oc-yang:counter64;
+ description
+ "The number of packets which have matched, and been forwarded,
+ based on the AFT entry.";
+ }
+
+ leaf octets-forwarded {
+ type oc-yang:counter64;
+ description
+ "The number of octets which have matched, and been forwarded,
+ based on the AFT entry";
+ }
+ }
+
+ grouping aft-common-entry-nexthop-config {
+ description
+ "Configuration parameters relating to a next-hop entry for a AFT
+ entry";
+
+ leaf index {
+ type uint64;
+ description
+ "A unique entry for the next-hop.";
+ }
+ }
+
+ grouping aft-common-entry-nexthop-state {
+ description
+ "Parameters relating to a next-hop within the AFT entry";
+
+ leaf weight {
+ type uint32;
+ description
+ "The weight of the next-hop. Traffic is balanced according to
+ the ratio described by the relative weights of the next hops
+ that exist for the AFT entry. Note that all next-hops that are
+ specified are assumed to be active next-hops and therefore
+ eligible (and selected) to be installed in the FIB, and hence
+ used for packet forwarding.";
+ }
+
+ leaf ip-address {
+ type oc-inet:ip-address;
+ description
+ "The IP address of the next-hop system.";
+ }
+
+ leaf mac-address {
+ type oc-yang:mac-address;
+ description
+ "The MAC address of the next-hop if resolved by the local
+ network instance.";
+ }
+
+ leaf-list popped-mpls-label-stack {
+ type oc-mplst:mpls-label;
+ description
+ "The MPLS label stack to be popped from the packet when
+ switched by the system. The stack is encoded as a leaf-list
+ such that the first entry is the label that is outer-most (i.e.,
+ furthest from the bottom of the stack) label
+ stack to be popped.
+
+ If the local system pops the outer-most label 400, then the
+ value of this list is [400,]. If the local system removes two
+ labels, the outer-most being 500, and the second of which is
+ 400, then the value of the list is [500, 400].
+
+ A swap operation is reflected by entries in the
+ popped-mpls-label-stack and pushed-mpls-label-stack nodes.";
+ }
+
+ leaf-list pushed-mpls-label-stack {
+ type oc-mplst:mpls-label;
+ ordered-by user;
+ description
+ "The MPLS label stack imposed when forwarding packets to the
+ next-hop
+ - the stack is encoded as a leaf list whereby the order of the
+ entries is such that the first entry in the list is the
+ label at the bottom of the stack to be pushed.
+
+ To this end, a packet which is to forwarded to a device using
+ a service label of 42, and a transport label of 8072 will be
+ represented with a label stack list of [42, 8072].
+
+ The MPLS label stack list is ordered by the user, such that no
+ system re-ordering of leaves is permitted by the system.
+
+ A swap operation is reflected by entries in the
+ popped-mpls-label-stack and pushed-mpls-label-stack nodes.";
+
+ }
+
+ leaf decapsulate-header {
+ type oc-aftt:encapsulation-header-type;
+ description
+ "When forwarding a packet to the specified next-hop, the local
+ system performs a decapsulation of the packet - removing the
+ specified header type. In the case that no next-hop is
+ specified, the packet header is removed, and a subsequent
+ forwarding lookup is performed on the packet encapsulated
+ within the header, matched within the relevant AFT within the
+ specified network-instance.";
+ }
+
+ leaf encapsulate-header {
+ type oc-aftt:encapsulation-header-type;
+ description
+ "When forwarding a packet to the specified next-hop the local
+ system performs an encapsulation of the packet - adding the
+ specified header type.";
+ }
+
+ leaf origin-protocol {
+ type identityref {
+ base "oc-pol-types:INSTALL_PROTOCOL_TYPE";
+ }
+ description
+ "The protocol from which the AFT entry was learned.";
+ }
+ }
+}
\ No newline at end of file
diff --git a/models/openconfig/src/main/yang/aft/openconfig-aft-ethernet.yang b/models/openconfig/src/main/yang/aft/openconfig-aft-ethernet.yang
new file mode 100644
index 0000000..cf933db
--- /dev/null
+++ b/models/openconfig/src/main/yang/aft/openconfig-aft-ethernet.yang
@@ -0,0 +1,89 @@
+submodule openconfig-aft-ethernet {
+ belongs-to "openconfig-aft" {
+ prefix "oc-aft";
+ }
+
+ import openconfig-extensions { prefix "oc-ext"; }
+ import openconfig-yang-types { prefix "oc-yang"; }
+
+ // Include common cross-AFT groupings from the common submodule.
+ include openconfig-aft-common;
+
+ oc-ext:openconfig-version "0.3.0";
+
+ organization
+ "OpenConfig working group";
+
+ contact
+ "OpenConfig working group
+ www.openconfig.net";
+
+ description
+ "Submodule containing definitions of groupings for the abstract
+ forwarding tables for Ethernet.";
+
+ revision 2017-05-10 {
+ description
+ "Refactor to provide concretised per-AF schemas per AFT.";
+ reference "0.3.0";
+ }
+
+ grouping aft-ethernet-structural {
+ description
+ "Structural grouping defining the schema for the Ethernet
+ abstract forwarding table.";
+
+ list mac-entry {
+ key "mac-address";
+
+ description
+ "List of the Ethernet entries within the abstract
+ forwarding table. This list is keyed by the outer MAC address
+ of the Ethernet frame.";
+
+ leaf mac-address {
+ type leafref {
+ path "../config/mac-address";
+ }
+ description
+ "Reference to the outer MAC address matched by the
+ entry.";
+ }
+
+ container config {
+ description
+ "Configuration parameters for the Ethernet AFT entry.";
+ uses aft-ethernet-entry-config;
+ }
+
+ container state {
+ config false;
+ description
+ "Operational state parameters for the Ethernet AFT
+ entry.";
+ uses aft-ethernet-entry-config;
+ uses aft-ethernet-entry-state;
+ }
+
+ uses aft-common-nhop-structural;
+ }
+ }
+
+ grouping aft-ethernet-entry-config {
+ description
+ "Configuration parameters for the Ethernet AFT entry.";
+
+ leaf mac-address {
+ type oc-yang:mac-address;
+ description
+ "The outer MAC address of the Ethernet frame that must
+ be matched for the AFT entry to be utilised.";
+ }
+ }
+
+ grouping aft-ethernet-entry-state {
+ description
+ "Operational state parameters for the Ethernet AFT entry.";
+ uses aft-common-entry-state;
+ }
+}
\ No newline at end of file
diff --git a/models/openconfig/src/main/yang/aft/openconfig-aft-ipv4.yang b/models/openconfig/src/main/yang/aft/openconfig-aft-ipv4.yang
new file mode 100644
index 0000000..7f9a316
--- /dev/null
+++ b/models/openconfig/src/main/yang/aft/openconfig-aft-ipv4.yang
@@ -0,0 +1,89 @@
+submodule openconfig-aft-ipv4 {
+ belongs-to "openconfig-aft" {
+ prefix "oc-aft";
+ }
+
+ import openconfig-extensions { prefix "oc-ext"; }
+ import openconfig-inet-types { prefix "oc-inet"; }
+
+ // Include common cross-AFT groupings from the common submodule.
+ include openconfig-aft-common;
+
+ oc-ext:openconfig-version "0.3.0";
+
+ organization
+ "OpenConfig working group";
+
+ contact
+ "OpenConfig working group
+ www.openconfig.net";
+
+ description
+ "Submodule containing definitions of groupings for the abstract
+ forwarding tables for IPv4.";
+
+ revision 2017-05-10 {
+ description
+ "Refactor to provide concretised per-AF schemas per AFT.";
+ reference "0.3.0";
+ }
+
+ grouping aft-ipv4-unicast-structural {
+ description
+ "Structural grouping defining the schema for the IPv4 unicast
+ abstract forwarding table.";
+
+ list ipv4-entry {
+ key "prefix";
+
+ description
+ "List of the IPv4 unicast entries within the abstract
+ forwarding table. This list is keyed by the destination IPv4
+ prefix.";
+
+ leaf prefix {
+ type leafref {
+ path "../config/prefix";
+ }
+ description
+ "Reference to the IPv4 unicast destination prefix which
+ must be matched to utilise the AFT entry.";
+ }
+
+ container config {
+ description
+ "Configuration parameters for the IPv4 unicast AFT entry.";
+ uses aft-ipv4-unicast-entry-config;
+ }
+
+ container state {
+ config false;
+ description
+ "Operational state parameters for the IPv4 unicast AFT
+ entry.";
+ uses aft-ipv4-unicast-entry-config;
+ uses aft-ipv4-unicast-entry-state;
+ }
+
+ uses aft-common-nhop-structural;
+ }
+ }
+
+ grouping aft-ipv4-unicast-entry-config {
+ description
+ "Configuration parameters for the IPv4 unicast entry.";
+
+ leaf prefix {
+ type oc-inet:ipv4-prefix;
+ description
+ "The IPv4 destination prefix that should be matched to
+ utilise the AFT entry.";
+ }
+ }
+
+ grouping aft-ipv4-unicast-entry-state {
+ description
+ "Operational state parameters for the IPv4 unicast entry.";
+ uses aft-common-entry-state;
+ }
+}
\ No newline at end of file
diff --git a/models/openconfig/src/main/yang/aft/openconfig-aft-ipv6.yang b/models/openconfig/src/main/yang/aft/openconfig-aft-ipv6.yang
new file mode 100644
index 0000000..9cca582
--- /dev/null
+++ b/models/openconfig/src/main/yang/aft/openconfig-aft-ipv6.yang
@@ -0,0 +1,89 @@
+submodule openconfig-aft-ipv6 {
+ belongs-to "openconfig-aft" {
+ prefix "oc-aft";
+ }
+
+ import openconfig-extensions { prefix "oc-ext"; }
+ import openconfig-inet-types { prefix "oc-inet"; }
+
+ // Include common cross-AFT groupings from the common submodule.
+ include openconfig-aft-common;
+
+ oc-ext:openconfig-version "0.3.0";
+
+ organization
+ "OpenConfig working group";
+
+ contact
+ "OpenConfig working group
+ www.openconfig.net";
+
+ description
+ "Submodule containing definitions of groupings for the abstract
+ forwarding tables for IPv6.";
+
+ revision 2017-05-10 {
+ description
+ "Refactor to provide concretised per-AF schemas per AFT.";
+ reference "0.3.0";
+ }
+
+ grouping aft-ipv6-unicast-structural {
+ description
+ "Structural grouping defining the schema for the IPv6 unicast
+ abstract forwarding table.";
+
+ list ipv6-entry {
+ key "prefix";
+
+ description
+ "List of the IPv6 unicast entries within the abstract
+ forwarding table. This list is keyed by the destination IPv6
+ prefix.";
+
+ leaf prefix {
+ type leafref {
+ path "../config/prefix";
+ }
+ description
+ "Reference to the IPv6 unicast destination prefix which
+ must be matched to utilise the AFT entry.";
+ }
+
+ container config {
+ description
+ "Configuration parameters for the IPv6 unicast AFT entry.";
+ uses aft-ipv6-unicast-entry-config;
+ }
+
+ container state {
+ config false;
+ description
+ "Operational state parameters for the IPv6 unicast AFT
+ entry.";
+ uses aft-ipv6-unicast-entry-config;
+ uses aft-ipv6-unicast-entry-state;
+ }
+
+ uses aft-common-nhop-structural;
+ }
+ }
+
+ grouping aft-ipv6-unicast-entry-config {
+ description
+ "Configuration parameters for the IPv6 unicast entry.";
+
+ leaf prefix {
+ type oc-inet:ipv6-prefix;
+ description
+ "The IPv6 destination prefix that should be matched to
+ utilise the AFT entry.";
+ }
+ }
+
+ grouping aft-ipv6-unicast-entry-state {
+ description
+ "Operational state parameters for the IPv6 unicast entry.";
+ uses aft-common-entry-state;
+ }
+}
\ No newline at end of file
diff --git a/models/openconfig/src/main/yang/aft/openconfig-aft-mpls.yang b/models/openconfig/src/main/yang/aft/openconfig-aft-mpls.yang
new file mode 100644
index 0000000..38e5cc0
--- /dev/null
+++ b/models/openconfig/src/main/yang/aft/openconfig-aft-mpls.yang
@@ -0,0 +1,89 @@
+submodule openconfig-aft-mpls {
+ belongs-to "openconfig-aft" {
+ prefix "oc-aft";
+ }
+
+ import openconfig-extensions { prefix "oc-ext"; }
+ import openconfig-mpls-types { prefix "oc-mpls-types"; }
+
+ // Include common cross-AFT groupings from the common submodule.
+ include openconfig-aft-common;
+
+ oc-ext:openconfig-version "0.3.0";
+
+ organization
+ "OpenConfig working group";
+
+ contact
+ "OpenConfig working group
+ www.openconfig.net";
+
+ description
+ "Submodule containing definitions of groupings for the abstract
+ forwarding table for MPLS label forwarding.";
+
+ revision 2017-05-10 {
+ description
+ "Refactor to provide concretised per-AF schemas per AFT.";
+ reference "0.3.0";
+ }
+
+ grouping aft-mpls-structural {
+ description
+ "Structural grouping defining the schema for the MPLS
+ abstract forwarding table.";
+
+ list label-entry {
+ key "label";
+
+ description
+ "List of the MPLS entries within the abstract
+ forwarding table. This list is keyed by the top-most MPLS
+ label.";
+
+ leaf label {
+ type leafref {
+ path "../config/label";
+ }
+ description
+ "Reference to the top-most MPLS label matched by the
+ entry.";
+ }
+
+ container config {
+ description
+ "Configuration parameters for the MPLS AFT entry.";
+ uses aft-mpls-entry-config;
+ }
+
+ container state {
+ config false;
+ description
+ "Operational state parameters for the MPLS AFT
+ entry.";
+ uses aft-mpls-entry-config;
+ uses aft-mpls-entry-state;
+ }
+
+ uses aft-common-nhop-structural;
+ }
+ }
+
+ grouping aft-mpls-entry-config {
+ description
+ "Configuration parameters for the MPLS entry.";
+
+ leaf label {
+ type oc-mpls-types:mpls-label;
+ description
+ "The top-most MPLS label that should be matched to
+ utilise the AFT entry.";
+ }
+ }
+
+ grouping aft-mpls-entry-state {
+ description
+ "Operational state parameters for the MPLS entry.";
+ uses aft-common-entry-state;
+ }
+}
\ No newline at end of file
diff --git a/models/openconfig/src/main/yang/aft/openconfig-aft-network-instance.yang b/models/openconfig/src/main/yang/aft/openconfig-aft-network-instance.yang
new file mode 100644
index 0000000..b42c8ed
--- /dev/null
+++ b/models/openconfig/src/main/yang/aft/openconfig-aft-network-instance.yang
@@ -0,0 +1,115 @@
+module openconfig-aft-network-instance {
+ yang-version "1";
+
+ namespace "http://openconfig.net/yang/aft/ni";
+ prefix "oc-aftni";
+
+ import openconfig-extensions { prefix "oc-ext"; }
+ import openconfig-network-instance { prefix "oc-ni"; }
+
+ organization
+ "OpenConfig working group";
+
+ contact
+ "OpenConfig working group
+ www.openconfig.net";
+
+ description
+ "This module provides augmentations that are utilized
+ when building the OpenConfig network instance model to
+ add per-NI AFTs.";
+
+ oc-ext:openconfig-version "0.2.1";
+
+ revision 2017-01-13 {
+ description
+ "Updated revision for external review";
+ reference "0.2.1";
+ }
+
+
+ typedef network-instance-ref {
+ type leafref {
+ path "/oc-ni:network-instances/oc-ni:network-instance/oc-ni:config/oc-ni:name";
+ }
+ description
+ "A re-usable type that can be referenced within other
+ modules that references a network instance.";
+ }
+
+ augment "/oc-ni:network-instances/oc-ni:network-instance/" +
+ "oc-ni:afts/oc-ni:ipv4-unicast/oc-ni:ipv4-entry/" +
+ "oc-ni:next-hops/oc-ni:next-hop/oc-ni:state" {
+
+ description
+ "Add leaves that require referencing of a network instance to the
+ operational state parameters of a next-hop within the AFT for IPv4
+ unicast.";
+
+ uses aft-nexthop-ni-state;
+ }
+
+ augment "/oc-ni:network-instances/oc-ni:network-instance/" +
+ "oc-ni:afts/oc-ni:ipv6-unicast/oc-ni:ipv6-entry/" +
+ "oc-ni:next-hops/oc-ni:next-hop/oc-ni:state" {
+
+ description
+ "Add leaves that require referencing of a network instance to the
+ operational state parameters of a next-hop within the AFT for IPv6
+ unicast.";
+
+ uses aft-nexthop-ni-state;
+ }
+
+ grouping aft-nexthop-ni-state {
+ description
+ "Operational state parameters relating to a next-hop which reference a
+ network instance.";
+
+ leaf network-instance {
+ type network-instance-ref;
+ description
+ "The network-instance within which the next-hop should be resolved.
+ When this leaf is unspecified, the next-hop is resolved within
+ the local instance.";
+ }
+ }
+
+ augment "/oc-ni:network-instances/oc-ni:network-instance/" +
+ "oc-ni:afts/oc-ni:ipv4-unicast/oc-ni:ipv4-entry/oc-ni:state" {
+ description
+ "Add leaves that require referencing of a network instance to the
+ operational state parameters of an entry within the IPv4 unicast AFT.";
+
+ uses aft-entry-ni-state;
+ }
+
+ augment "/oc-ni:network-instances/oc-ni:network-instance/" +
+ "oc-ni:afts/oc-ni:ipv6-unicast/oc-ni:ipv6-entry/oc-ni:state" {
+ description
+ "Add leaves that require referencing of a network instance to the
+ operational state parameters of an entry within the IPv6 unicast AFT.";
+
+ uses aft-entry-ni-state;
+ }
+
+ grouping aft-entry-ni-state {
+ description
+ "Operational state parameters relating to an AFT entry which reference
+ a network instance.";
+
+ leaf origin-network-instance {
+ type network-instance-ref;
+ description
+ "If the AFT entry was imported from another network instance (e.g., it
+ corresponds to a L3 forwarding entry which was learned within another
+ network-instance), the value of this leaf reflects the network-instance
+ from which it was learned.
+
+ For example, if the local network-instance corresponds to a L3VRF, and
+ routes are imported from the VPNv4 address-family of the BGP instance
+ in the DEFAULT_INSTANCE, then this value would reflect the
+ DEFAULT_INSTANCE as the origin-network-instance.";
+ }
+ }
+}
diff --git a/models/openconfig/src/main/yang/aft/openconfig-aft-pf.yang b/models/openconfig/src/main/yang/aft/openconfig-aft-pf.yang
new file mode 100644
index 0000000..707bb8b
--- /dev/null
+++ b/models/openconfig/src/main/yang/aft/openconfig-aft-pf.yang
@@ -0,0 +1,168 @@
+submodule openconfig-aft-pf {
+ belongs-to "openconfig-aft" {
+ prefix "oc-aft";
+ }
+
+ import openconfig-extensions { prefix "oc-ext"; }
+ import openconfig-inet-types { prefix "oc-inet"; }
+ import openconfig-yang-types { prefix "oc-yang"; }
+ import openconfig-mpls-types { prefix "oc-mplst"; }
+ import openconfig-packet-match-types {
+ prefix "oc-pkt-match-types";
+ }
+
+ // Include common cross-AFT groupings from the common submodule.
+ include openconfig-aft-common;
+
+ organization
+ "OpenConfig working group";
+
+ contact
+ "OpenConfig working group
+ www.openconfig.net";
+
+ description
+ "Submodule containing definitions of groupings for the abstract
+ forwarding table(s) for policy forwarding entries. These are
+ defined to be forwarding tables that allow matches on
+ fields other than the destination address that is used in
+ other forwarding tables.";
+
+ oc-ext:openconfig-version "0.3.0";
+
+ revision 2017-05-10 {
+ description
+ "Refactor to provide concretised per-AF schemas per AFT.";
+ reference "0.3.0";
+ }
+
+ grouping aft-pf-structural {
+ description
+ "Structural grouping defining the schema for the policy
+ forwarding abstract forwarding table.";
+
+ list policy-forwarding-entry {
+ key "index";
+
+ description
+ "List of the policy forwarding entries within the abstract
+ forwarding table. Each entry is uniquely identified by an
+ index on the system, due to the arbitrary match conditions
+ that may be implemented within the policy forwarding AFT.
+ The index may change upon changes of the entry if, and only
+ if, the device exporting the AFT replaces the entire entry
+ by removing the previous entry and replacing it with a
+ subsequent updated version.";
+
+ leaf index {
+ type leafref {
+ path "../config/index";
+ }
+ description
+ "Reference to the arbitary index for the policy forwarding
+ AFT entry.";
+ }
+
+ container config {
+ description
+ "Configuration parameters for the Policy forwarding
+ AFT entry.";
+ uses aft-pf-entry-config;
+ }
+
+ container state {
+ config false;
+ description
+ "Operational state parameters for the Policy Forwarding
+ AFT entry.";
+ uses aft-pf-entry-config;
+ uses aft-pf-entry-state;
+ }
+
+ uses aft-common-nhop-structural;
+ }
+ }
+
+ grouping aft-pf-entry-config {
+ description
+ "Configuration parameters for the Policy Forwarding
+ AFT entry.";
+
+ leaf index {
+ type uint64;
+ description
+ "An arbitrary 64-bit index identifying the policy forwarding
+ AFT entry.";
+ }
+
+ leaf ip-prefix {
+ type oc-inet:ip-prefix;
+ description
+ "The IP prefix that the forwarding entry matches.";
+ }
+
+ leaf mac-address {
+ type oc-yang:mac-address;
+ description
+ "The MAC address that the forwarding entry matches. Used for
+ Layer 2 forwarding entries, e.g., within a VSI instance.";
+ }
+
+ leaf mpls-label {
+ type oc-mplst:mpls-label;
+ description
+ "The MPLS label that the forwarding entry matches. Used for
+ MPLS forwarding entries, whereby the local device acts as an
+ LSR.";
+ }
+
+ leaf mpls-tc {
+ type oc-mplst:mpls-tc;
+ description
+ "The value of the MPLS Traffic Class bits (formerly known as
+ the MPLS experimental bits) that are to be matched by the AFT
+ entry.";
+ reference
+ "RFC5462: Multiprotocol Label Switching (MPLS) Label Stack
+ Entry: 'EXP' Field Renamed to 'Traffic Class' Field"; }
+
+ leaf ip-dscp {
+ type oc-inet:dscp;
+ description
+ "The value of the differentiated services code point (DSCP) to
+ be matched for the forwarding entry. The value is specified in
+ cases where specific class-based forwarding based on IP is
+ implemented by the device.";
+ }
+
+ leaf ip-protocol {
+ type oc-pkt-match-types:ip-protocol-type;
+ description
+ "The value of the IP protocol field of an IPv4 packet, or the
+ next-header field of an IPv6 packet which is to be matched by
+ the AFT entry. This field is utilised where forwarding is
+ performed based on L4 information.";
+ }
+
+ leaf l4-src-port {
+ type oc-inet:port-number;
+ description
+ "The value of the source port field of the transport header
+ that is to be matched by the AFT entry.";
+ }
+
+ leaf l4-dst-port {
+ type oc-inet:port-number;
+ description
+ "The value of the destination port field of the transport
+ header that is to be matched by the AFT entry.";
+ }
+ }
+
+ grouping aft-pf-entry-state {
+ description
+ "Operational state parameters for the Policy Forwarding
+ AFT entry.";
+ uses aft-common-entry-state;
+ }
+}
\ No newline at end of file
diff --git a/models/openconfig/src/main/yang/aft/openconfig-aft-types.yang b/models/openconfig/src/main/yang/aft/openconfig-aft-types.yang
new file mode 100644
index 0000000..1476ea0
--- /dev/null
+++ b/models/openconfig/src/main/yang/aft/openconfig-aft-types.yang
@@ -0,0 +1,52 @@
+module openconfig-aft-types {
+
+ namespace "http://openconfig.net/yang/fib-types";
+ prefix "oc-aftt";
+
+ import openconfig-extensions { prefix "oc-ext"; }
+
+ organization
+ "OpenConfig Working Group";
+
+ contact
+ "OpenConfig Working Group
+ www.openconfig.net";
+
+ description
+ "Types related to the OpenConfig Abstract Forwarding
+ Table (AFT) model";
+
+ oc-ext:openconfig-version "0.3.0";
+
+ revision 2017-05-10 {
+ description
+ "Refactor to provide concretised per-AF schemas per AFT.";
+ reference "0.3.0";
+ }
+
+ typedef encapsulation-header-type {
+ type enumeration {
+ enum GRE {
+ description
+ "The encapsulation header is a Generic Routing Encapsulation
+ header.";
+ }
+ enum IPV4 {
+ description
+ "The encapsulation header is an IPv4 packet header";
+ }
+ enum IPV6 {
+ description
+ "The encapsulation header is an IPv6 packet header";
+ }
+ enum MPLS {
+ description
+ "The encapsulation header is one or more MPLS labels indicated
+ by the pushed and popped label stack lists.";
+ }
+ }
+ description
+ "Types of tunnel encapsulation that are supported by systems as either
+ head- or tail-end.";
+ }
+}
diff --git a/models/openconfig/src/main/yang/aft/openconfig-aft.yang b/models/openconfig/src/main/yang/aft/openconfig-aft.yang
new file mode 100644
index 0000000..98b9362
--- /dev/null
+++ b/models/openconfig/src/main/yang/aft/openconfig-aft.yang
@@ -0,0 +1,136 @@
+module openconfig-aft {
+
+ yang-version "1";
+
+ namespace "http://openconfig.net/yang/aft";
+
+ prefix "oc-aft";
+
+ import openconfig-extensions { prefix "oc-ext"; }
+
+ // Include IPv4 AFT submodule.
+ include openconfig-aft-ipv4;
+ // Include IPv6 AFT submodule.
+ include openconfig-aft-ipv6;
+ // Include MPLS AFT submodule.
+ include openconfig-aft-mpls;
+ // Include policy forwarding AFT submodule.
+ include openconfig-aft-pf;
+ // Include the ethernet AFT submodule.
+ include openconfig-aft-ethernet;
+ // Include the common cross-AFT entities.
+ include openconfig-aft-common;
+
+ organization
+ "OpenConfig working group";
+
+ contact
+ "OpenConfig working group
+ www.openconfig.net";
+
+ description
+ "A model describing the forwarding entries installed on a network
+ element. It should be noted that this model is not expected to
+ align 1:1 with the underlying structure used directly by a
+ forwarding element (e.g., linecard), but rather provide an
+ abstraction that can be consumed by an NMS to observe, and in some
+ cases manipulate, the internal forwarding database in a simplified
+ manner. Since the underlying model of the forwarding table is not
+ expected to align with this model, the structure described herein
+ is referred to as an Abstract Forwarding Table (AFT), rather than
+ the FIB.";
+
+ oc-ext:openconfig-version "0.3.0";
+
+ revision 2017-05-10 {
+ description
+ "Refactor to provide concretised per-AF schemas per AFT.";
+ reference "0.3.0";
+ }
+
+ // config + state groupings
+
+ // structural groupings
+
+ grouping aft-top {
+ description
+ "Top-level grouping allowing per-protocol instantiation of the
+ AFT.";
+
+ container afts {
+ description
+ "The abstract forwarding tables (AFTs) that are associated
+ with the network instance. An AFT is instantiated per-protocol
+ running within the network-instance - such that one exists for
+ IPv4 Unicast, IPv6 Unicast, MPLS, L2 forwarding entries, etc.
+ A forwarding entry within the FIB has a set of next-hops,
+ which may be a reference to an entry within another table -
+ e.g., where a Layer 3 next-hop has an associated Layer 2
+ forwarding entry.";
+
+ container ipv4-unicast {
+ description
+
+ "The abstract forwarding table for IPv4 unicast. Entries
+ within this table are uniquely keyed on the IPv4 unicast
+ destination prefix which is matched by ingress packets.
+
+ The data set represented by the IPv4 Unicast AFT is the set
+ of entries from the IPv4 unicast RIB that have been selected
+ for installation into the FIB of the device exporting the
+ data structure.";
+
+ uses aft-ipv4-unicast-structural;
+ }
+
+ container ipv6-unicast {
+ description
+ "The abstract forwarding table for IPv6 unicast. Entries
+ within this table are uniquely keyed on the IPv6 unicast
+ destination prefix which is matched by ingress packets.
+
+ The data set represented by the IPv6 Unicast AFTis the set
+ of entries within the IPv6 RIB that ";
+
+ uses aft-ipv6-unicast-structural;
+
+ }
+
+ container policy-forwarding {
+ description
+ "The abstract forwarding table for policy-based forwarding
+ entries. Since multiple match criteria can be utilised
+ within a policy-based forwarding rule, this AFT provides a
+ flexible match criteria, and is indexed based on an
+ arbitrary 64-bit index. Entries within the AFT may match on
+ multiple field types (e.g., L4 header fields, as well as L2
+ fields).
+
+ Examples of entries within this table are:
+ - IPv4 policy-based routing based on DSCP.
+ - MPLS policy-based forwarding entries.";
+
+ uses aft-pf-structural;
+ }
+
+ container mpls {
+ description
+ "The abstract forwarding table for MPLS label based
+ forwarding entries. Entries within the table are keyed based
+ on the top-most MPLS label in the stack on the ingress
+ packet.";
+
+ uses aft-mpls-structural;
+ }
+
+ container ethernet {
+ description
+ "The abstract forwarding table for Ethernet based forwarding
+ entries. Entries within the table are keyed based on the
+ destination MAC address on the ingress packet.";
+
+ uses aft-ethernet-structural;
+ }
+ }
+ }
+}