Adding OpenConfig YANG models.
Change-Id: I0a2fdd5826e80933cf4b9ae939ff3051acec02aa
diff --git a/models/openconfig/src/main/yang/interfaces/openconfig-if-aggregate.yang b/models/openconfig/src/main/yang/interfaces/openconfig-if-aggregate.yang
new file mode 100644
index 0000000..8115652
--- /dev/null
+++ b/models/openconfig/src/main/yang/interfaces/openconfig-if-aggregate.yang
@@ -0,0 +1,200 @@
+module openconfig-if-aggregate {
+
+ yang-version "1";
+
+ // namespace
+ namespace "http://openconfig.net/yang/interfaces/aggregate";
+
+ prefix "oc-lag";
+
+ // import some basic types
+ import openconfig-interfaces { prefix oc-if; }
+ import openconfig-if-ethernet { prefix oc-eth; }
+ import iana-if-type { prefix ift; }
+ import openconfig-extensions { prefix oc-ext; }
+
+ // meta
+ organization "OpenConfig working group";
+
+ contact
+ "OpenConfig working group
+ netopenconfig@googlegroups.com";
+
+ description
+ "Model for managing aggregated (aka bundle, LAG) interfaces.";
+
+ oc-ext:openconfig-version "2.0.0";
+
+ revision "2017-07-14" {
+ description
+ "Added Ethernet/IP state data; Add dhcp-client;
+ migrate to OpenConfig types modules; Removed or
+ renamed opstate values";
+ reference "2.0.0";
+ }
+
+ revision "2016-12-22" {
+ description
+ "Fixes to Ethernet interfaces model";
+ reference "1.1.0";
+ }
+
+ // extension statements
+
+ // feature statements
+
+ // identity statements
+
+ // typedef statements
+
+
+
+ typedef aggregation-type {
+ type enumeration {
+ enum LACP {
+ description "LAG managed by LACP";
+ }
+ enum STATIC {
+ description "Statically configured bundle / LAG";
+ }
+ }
+ description
+ "Type to define the lag-type, i.e., how the LAG is
+ defined and managed";
+ }
+
+ // grouping statements
+
+
+ grouping aggregation-logical-config {
+ description
+ "Configuration data for aggregate interfaces";
+
+
+ leaf lag-type {
+ type aggregation-type;
+ description
+ "Sets the type of LAG, i.e., how it is
+ configured / maintained";
+ }
+
+ leaf min-links {
+ type uint16;
+ description
+ "Specifies the mininum number of member
+ interfaces that must be active for the aggregate interface
+ to be available";
+ }
+ }
+
+ grouping aggregation-logical-state {
+ description
+ "Operational state data for aggregate interfaces";
+
+ leaf lag-speed {
+ type uint32;
+ units Mbps;
+ description
+ "Reports effective speed of the aggregate interface,
+ based on speed of active member interfaces";
+ }
+
+ leaf-list member {
+ when "oc-lag:lag-type = 'STATIC'" {
+ description
+ "The simple list of member interfaces is active
+ when the aggregate is statically configured";
+ }
+ type oc-if:base-interface-ref;
+ description
+ "List of current member interfaces for the aggregate,
+ expressed as references to existing interfaces";
+ }
+ }
+
+ grouping aggregation-logical-top {
+ description "Top-level data definitions for LAGs";
+
+ container aggregation {
+
+ description
+ "Options for logical interfaces representing
+ aggregates";
+
+ container config {
+ description
+ "Configuration variables for logical aggregate /
+ LAG interfaces";
+
+ uses aggregation-logical-config;
+ }
+
+ container state {
+
+ config false;
+ description
+ "Operational state variables for logical
+ aggregate / LAG interfaces";
+
+ uses aggregation-logical-config;
+ uses aggregation-logical-state;
+
+ }
+ }
+ }
+
+ grouping ethernet-if-aggregation-config {
+ description
+ "Adds configuration items for Ethernet interfaces
+ belonging to a logical aggregate / LAG";
+
+ leaf aggregate-id {
+ type leafref {
+ path "/oc-if:interfaces/oc-if:interface/oc-if:name";
+ }
+ description
+ "Specify the logical aggregate interface to which
+ this interface belongs";
+ }
+ }
+
+ // data definition statements
+
+ // augment statements
+
+ augment "/oc-if:interfaces/oc-if:interface" {
+ when "oc-if:type = 'ift:ieee8023adLag'" {
+ description "active when the interface is set to type LAG";
+ }
+ description "Adds LAG configuration to the interface module";
+
+ uses aggregation-logical-top;
+ }
+
+ augment "/oc-if:interfaces/oc-if:interface/oc-eth:ethernet/" +
+ "oc-eth:config" {
+ when "oc-if:type = 'ift:ethernetCsmacd'" {
+ description "active when the interface is Ethernet";
+ }
+ description "Adds LAG settings to individual Ethernet
+ interfaces";
+
+ uses ethernet-if-aggregation-config;
+ }
+
+ augment "/oc-if:interfaces/oc-if:interface/oc-eth:ethernet/" +
+ "oc-eth:state" {
+ when "oc-if:type = 'ift:ethernetCsmacd'" {
+ description "active when the interface is Ethernet";
+ }
+ description "Adds LAG settings to individual Ethernet
+ interfaces";
+
+ uses ethernet-if-aggregation-config;
+ }
+
+ // rpc statements
+
+ // notification statements
+
+}
diff --git a/models/openconfig/src/main/yang/interfaces/openconfig-if-ethernet.yang b/models/openconfig/src/main/yang/interfaces/openconfig-if-ethernet.yang
new file mode 100644
index 0000000..0a3c2e8
--- /dev/null
+++ b/models/openconfig/src/main/yang/interfaces/openconfig-if-ethernet.yang
@@ -0,0 +1,345 @@
+module openconfig-if-ethernet {
+
+ yang-version "1";
+
+ // namespace
+ namespace "http://openconfig.net/yang/interfaces/ethernet";
+
+ prefix "oc-eth";
+
+ // import some basic types
+ import openconfig-interfaces { prefix oc-if; }
+ import iana-if-type { prefix ift; }
+ import openconfig-yang-types { prefix oc-yang; }
+ import openconfig-extensions { prefix oc-ext; }
+
+ // meta
+ organization "OpenConfig working group";
+
+ contact
+ "OpenConfig working group
+ netopenconfig@googlegroups.com";
+
+ description
+ "Model for managing Ethernet interfaces -- augments the IETF YANG
+ model for interfaces described by RFC 7223";
+
+ oc-ext:openconfig-version "2.0.0";
+
+ revision "2017-07-14" {
+ description
+ "Added Ethernet/IP state data; Add dhcp-client;
+ migrate to OpenConfig types modules; Removed or
+ renamed opstate values";
+ reference "2.0.0";
+ }
+
+ revision "2016-12-22" {
+ description
+ "Fixes to Ethernet interfaces model";
+ reference "1.1.0";
+ }
+
+ // extension statements
+
+ // feature statements
+
+ // identity statements
+
+ identity ETHERNET_SPEED {
+ description "base type to specify available Ethernet link
+ speeds";
+ }
+
+ identity SPEED_10MB {
+ base ETHERNET_SPEED;
+ description "10 Mbps Ethernet";
+ }
+
+ identity SPEED_100MB {
+ base ETHERNET_SPEED;
+ description "100 Mbps Ethernet";
+ }
+
+ identity SPEED_1GB {
+ base ETHERNET_SPEED;
+ description "1 GBps Ethernet";
+ }
+
+ identity SPEED_10GB {
+ base ETHERNET_SPEED;
+ description "10 GBps Ethernet";
+ }
+
+ identity SPEED_25GB {
+ base ETHERNET_SPEED;
+ description "25 GBps Ethernet";
+ }
+
+ identity SPEED_40GB {
+ base ETHERNET_SPEED;
+ description "40 GBps Ethernet";
+ }
+
+ identity SPEED_50GB {
+ base ETHERNET_SPEED;
+ description "50 GBps Ethernet";
+ }
+
+ identity SPEED_100GB {
+ base ETHERNET_SPEED;
+ description "100 GBps Ethernet";
+ }
+
+ identity SPEED_UNKNOWN {
+ base ETHERNET_SPEED;
+ description
+ "Interface speed is unknown. Systems may report
+ speed UNKNOWN when an interface is down or unpopuplated (e.g.,
+ pluggable not present).";
+ }
+
+ // typedef statements
+
+
+ // grouping statements
+
+ grouping ethernet-interface-config {
+ description "Configuration items for Ethernet interfaces";
+
+ leaf mac-address {
+ type oc-yang:mac-address;
+ description
+ "Assigns a MAC address to the Ethernet interface. If not
+ specified, the corresponding operational state leaf is
+ expected to show the system-assigned MAC address.";
+ }
+
+ leaf auto-negotiate {
+ type boolean;
+ default true;
+ description
+ "Set to TRUE to request the interface to auto-negotiate
+ transmission parameters with its peer interface. When
+ set to FALSE, the transmission parameters are specified
+ manually.";
+ reference
+ "IEEE 802.3-2012 auto-negotiation transmission parameters";
+ }
+
+ leaf duplex-mode {
+ type enumeration {
+ enum FULL {
+ description "Full duplex mode";
+ }
+ enum HALF {
+ description "Half duplex mode";
+ }
+ }
+ description
+ "When auto-negotiate is TRUE, this optionally sets the
+ duplex mode that will be advertised to the peer. If
+ unspecified, the interface should negotiate the duplex mode
+ directly (typically full-duplex). When auto-negotiate is
+ FALSE, this sets the duplex mode on the interface directly.";
+ }
+
+ leaf port-speed {
+ type identityref {
+ base ETHERNET_SPEED;
+ }
+ description
+ "When auto-negotiate is TRUE, this optionally sets the
+ port-speed mode that will be advertised to the peer for
+ negotiation. If unspecified, it is expected that the
+ interface will select the highest speed available based on
+ negotiation. When auto-negotiate is set to FALSE, sets the
+ link speed to a fixed value -- supported values are defined
+ by ETHERNET_SPEED identities";
+ }
+
+ leaf enable-flow-control {
+ type boolean;
+ default false;
+ description
+ "Enable or disable flow control for this interface.
+ Ethernet flow control is a mechanism by which a receiver
+ may send PAUSE frames to a sender to stop transmission for
+ a specified time.
+
+ This setting should override auto-negotiated flow control
+ settings. If left unspecified, and auto-negotiate is TRUE,
+ flow control mode is negotiated with the peer interface.";
+ reference
+ "IEEE 802.3x";
+ }
+ }
+
+ grouping ethernet-interface-state-counters {
+ description
+ "Ethernet-specific counters and statistics";
+
+ // ingress counters
+
+ leaf in-mac-control-frames {
+ type oc-yang:counter64;
+ description
+ "MAC layer control frames received on the interface";
+ }
+
+ leaf in-mac-pause-frames {
+ type oc-yang:counter64;
+ description
+ "MAC layer PAUSE frames received on the interface";
+ }
+
+ leaf in-oversize-frames {
+ type oc-yang:counter64;
+ description
+ "Number of oversize frames received on the interface";
+ }
+
+ leaf in-jabber-frames {
+ type oc-yang:counter64;
+ description
+ "Number of jabber frames received on the
+ interface. Jabber frames are typically defined as oversize
+ frames which also have a bad CRC. Implementations may use
+ slightly different definitions of what constitutes a jabber
+ frame. Often indicative of a NIC hardware problem.";
+ }
+
+ leaf in-fragment-frames {
+ type oc-yang:counter64;
+ description
+ "Number of fragment frames received on the interface.";
+ }
+
+ leaf in-8021q-frames {
+ type oc-yang:counter64;
+ description
+ "Number of 802.1q tagged frames received on the interface";
+ }
+
+ leaf in-crc-errors {
+ type oc-yang:counter64;
+ description
+ "Number of receive error events due to FCS/CRC check
+ failure";
+ }
+
+ // egress counters
+
+ leaf out-mac-control-frames {
+ type oc-yang:counter64;
+ description
+ "MAC layer control frames sent on the interface";
+ }
+
+ leaf out-mac-pause-frames {
+ type oc-yang:counter64;
+ description
+ "MAC layer PAUSE frames sent on the interface";
+ }
+
+ leaf out-8021q-frames {
+ type oc-yang:counter64;
+ description
+ "Number of 802.1q tagged frames sent on the interface";
+ }
+ }
+
+ grouping ethernet-interface-state {
+ description
+ "Grouping for defining Ethernet-specific operational state";
+
+ leaf hw-mac-address {
+ type oc-yang:mac-address;
+ description
+ "Represenets the 'burned-in', or system-assigned, MAC
+ address for the Ethernet interface.";
+ }
+
+ leaf negotiated-duplex-mode {
+ type enumeration {
+ enum FULL {
+ description "Full duplex mode";
+ }
+ enum HALF {
+ description "Half duplex mode";
+ }
+ }
+ description
+ "When auto-negotiate is set to TRUE, and the interface has
+ completed auto-negotiation with the remote peer, this value
+ shows the duplex mode that has been negotiated.";
+ }
+
+ leaf negotiated-port-speed {
+ type identityref {
+ base ETHERNET_SPEED;
+ }
+ description
+ "When auto-negotiate is set to TRUE, and the interface has
+ completed auto-negotiation with the remote peer, this value
+ shows the interface speed that has been negotiated.";
+ }
+
+ container counters {
+ description "Ethernet interface counters";
+
+ uses ethernet-interface-state-counters;
+
+ }
+
+ }
+
+ // data definition statements
+
+ grouping ethernet-top {
+ description "top-level Ethernet config and state containers";
+
+ container ethernet {
+ description
+ "Top-level container for ethernet configuration
+ and state";
+
+ container config {
+ description "Configuration data for ethernet interfaces";
+
+ uses ethernet-interface-config;
+
+ }
+
+ container state {
+
+ config false;
+ description "State variables for Ethernet interfaces";
+
+ uses ethernet-interface-config;
+ uses ethernet-interface-state;
+
+ }
+
+ }
+ }
+
+ // augment statements
+
+ augment "/oc-if:interfaces/oc-if:interface" {
+ description "Adds addtional Ethernet-specific configuration to
+ interfaces model";
+
+ uses ethernet-top {
+ when "oc-if:state/oc-if:type = 'ift:ethernetCsmacd'" {
+ description "Additional interface configuration parameters when
+ the interface type is Ethernet";
+ }
+ }
+ }
+
+ // rpc statements
+
+ // notification statements
+
+}
diff --git a/models/openconfig/src/main/yang/interfaces/openconfig-if-ip-ext.yang b/models/openconfig/src/main/yang/interfaces/openconfig-if-ip-ext.yang
new file mode 100644
index 0000000..558b0de
--- /dev/null
+++ b/models/openconfig/src/main/yang/interfaces/openconfig-if-ip-ext.yang
@@ -0,0 +1,157 @@
+module openconfig-if-ip-ext {
+
+ yang-version "1";
+
+ // namespace
+ namespace "http://openconfig.net/yang/interfaces/ip-ext";
+
+ prefix "oc-ip-ext";
+
+ import openconfig-interfaces { prefix oc-if; }
+ import openconfig-if-ip { prefix oc-ip; }
+ import openconfig-extensions { prefix oc-ext; }
+
+
+ // meta
+ organization "OpenConfig working group";
+
+ contact
+ "OpenConfig working group
+ www.openconfig.net";
+
+ description
+ "This module adds extensions to the base IP configuration and
+ operational state model to support additional use cases.";
+
+ oc-ext:openconfig-version "2.0.0";
+
+ revision "2017-07-14" {
+ description
+ "Added Ethernet/IP state data; Add dhcp-client;
+ migrate to OpenConfig types modules; Removed or
+ renamed opstate values";
+ reference "2.0.0";
+ }
+
+ revision "2016-12-22" {
+ description
+ "Fixes to Ethernet interfaces model";
+ reference "1.1.0";
+ }
+
+
+ // grouping statements
+
+ grouping ipv6-autoconf-config {
+ description
+ "Configuration data for IPv6 address autoconfiguration";
+
+ leaf create-global-addresses {
+ type boolean;
+ default true;
+ description
+ "[adapted from IETF IP model RFC 7277]
+
+ If enabled, the host creates global addresses as
+ described in RFC 4862.";
+ reference
+ "RFC 4862: IPv6 Stateless Address Autoconfiguration
+ Section 5.5";
+ }
+ leaf create-temporary-addresses {
+ type boolean;
+ default false;
+ description
+ "[adapted from IETF IP model RFC 7277]
+
+ If enabled, the host creates temporary addresses as
+ described in RFC 4941.";
+ reference
+ "RFC 4941: Privacy Extensions for Stateless Address
+ Autoconfiguration in IPv6";
+ }
+
+ leaf temporary-valid-lifetime {
+ type uint32;
+ units "seconds";
+ default 604800;
+ description
+ "[adapted from IETF IP model RFC 7277]
+
+ The time period during which the temporary address
+ is valid.";
+ reference
+ "RFC 4941: Privacy Extensions for Stateless Address
+ Autoconfiguration in IPv6
+ - TEMP_VALID_LIFETIME";
+ }
+
+ leaf temporary-preferred-lifetime {
+ type uint32;
+ units "seconds";
+ default 86400;
+ description
+ "[adapted from IETF IP model RFC 7277]
+
+ The time period during which the temporary address is
+ preferred.";
+ reference
+ "RFC 4941: Privacy Extensions for Stateless Address
+ Autoconfiguration in IPv6
+ - TEMP_PREFERRED_LIFETIME";
+ }
+ }
+
+ grouping ipv6-autoconf-state {
+ description
+ "Operational state data for IPv6 address autoconfiguration";
+
+ //TODO: placeholder for additional opstate for IPv6 autoconf
+ }
+
+ grouping ipv6-autoconf-top {
+ description
+ "Top-level grouping for IPv6 address autoconfiguration";
+
+ container autoconf {
+ description
+ "Top-level container for IPv6 autoconf";
+
+ container config {
+ description
+ "[adapted from IETF IP model RFC 7277]
+
+ Parameters to control the autoconfiguration of IPv6
+ addresses, as described in RFC 4862.";
+ reference
+ "RFC 4862: IPv6 Stateless Address Autoconfiguration";
+
+ uses ipv6-autoconf-config;
+ }
+
+ container state {
+
+ config false;
+
+ description
+ "Operational state data ";
+
+ uses ipv6-autoconf-config;
+ uses ipv6-autoconf-state;
+ }
+ }
+ }
+
+ // data definition statements
+
+ // augment statements
+
+ augment "/oc-if:interfaces/oc-if:interface/oc-if:subinterfaces/" +
+ "oc-if:subinterface/oc-ip:ipv6" {
+ description
+ "Adds address autoconfiguration to the base IP model";
+
+ uses ipv6-autoconf-top;
+ }
+
+}
\ No newline at end of file
diff --git a/models/openconfig/src/main/yang/interfaces/openconfig-if-ip.yang b/models/openconfig/src/main/yang/interfaces/openconfig-if-ip.yang
new file mode 100644
index 0000000..cc291de
--- /dev/null
+++ b/models/openconfig/src/main/yang/interfaces/openconfig-if-ip.yang
@@ -0,0 +1,1191 @@
+module openconfig-if-ip {
+
+ yang-version "1";
+
+ // namespace
+ namespace "http://openconfig.net/yang/interfaces/ip";
+
+ prefix "oc-ip";
+
+ // import some basic types
+ import openconfig-inet-types { prefix oc-inet; }
+ import openconfig-interfaces { prefix oc-if; }
+ import openconfig-vlan { prefix oc-vlan; }
+ import openconfig-yang-types { prefix oc-yang; }
+ import openconfig-extensions { prefix oc-ext; }
+
+ // meta
+ organization "OpenConfig working group";
+
+ contact
+ "OpenConfig working group
+ netopenconfig@googlegroups.com";
+
+ description
+ "This model defines data for managing configuration and
+ operational state on IP (IPv4 and IPv6) interfaces.
+
+ This model reuses data items defined in the IETF YANG model for
+ interfaces described by RFC 7277 with an alternate structure
+ (particularly for operational state data) and with
+ additional configuration items.
+
+ Portions of this code were derived from IETF RFC 7277.
+ Please reproduce this note if possible.
+
+ IETF code is subject to the following copyright and license:
+ Copyright (c) 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).";
+
+ oc-ext:openconfig-version "2.0.0";
+
+ revision "2017-07-14" {
+ description
+ "Added Ethernet/IP state data; Add dhcp-client;
+ migrate to OpenConfig types modules; Removed or
+ renamed opstate values";
+ reference "2.0.0";
+ }
+
+ revision "2017-04-03"{
+ description
+ "Update copyright notice.";
+ reference "1.1.1";
+ }
+
+ revision "2016-12-22" {
+ description
+ "Fixes to Ethernet interfaces model";
+ reference "1.1.0";
+ }
+
+
+ // typedef statements
+
+ typedef ip-address-origin {
+ type enumeration {
+ enum OTHER {
+ description
+ "None of the following.";
+ }
+ enum STATIC {
+ description
+ "Indicates that the address has been statically
+ configured - for example, using NETCONF or a Command Line
+ Interface.";
+ }
+ enum DHCP {
+ description
+ "Indicates an address that has been assigned to this
+ system by a DHCP server.";
+ }
+ enum LINK_LAYER {
+ description
+ "Indicates an address created by IPv6 stateless
+ autoconfiguration that embeds a link-layer address in its
+ interface identifier.";
+ }
+ enum RANDOM {
+ description
+ "Indicates an address chosen by the system at
+ random, e.g., an IPv4 address within 169.254/16, an
+ RFC 4941 temporary address, or an RFC 7217 semantically
+ opaque address.";
+ reference
+ "RFC 4941: Privacy Extensions for Stateless Address
+ Autoconfiguration in IPv6
+ RFC 7217: A Method for Generating Semantically Opaque
+ Interface Identifiers with IPv6 Stateless
+ Address Autoconfiguration (SLAAC)";
+ }
+ }
+ description
+ "The origin of an address.";
+ }
+
+ typedef neighbor-origin {
+ type enumeration {
+ enum OTHER {
+ description
+ "None of the following.";
+ }
+ enum STATIC {
+ description
+ "Indicates that the mapping has been statically
+ configured - for example, using NETCONF or a Command Line
+ Interface.";
+ }
+ enum DYNAMIC {
+ description
+ "Indicates that the mapping has been dynamically resolved
+ using, e.g., IPv4 ARP or the IPv6 Neighbor Discovery
+ protocol.";
+ }
+ }
+ description
+ "The origin of a neighbor entry.";
+ }
+
+ // grouping statements
+
+ grouping ip-common-global-config {
+ description
+ "Shared configuration data for IPv4 or IPv6 assigned
+ globally on an interface.";
+
+ leaf dhcp-client {
+ type boolean;
+ default false;
+ description
+ "Enables a DHCP client on the interface in order to request
+ an address";
+ }
+ }
+
+ grouping ip-common-counters-state {
+ description
+ "Operational state for IP traffic statistics for IPv4 and
+ IPv6";
+
+ container counters {
+ description
+ "Packet and byte counters for IP transmission and
+ reception for the address family.";
+
+
+ leaf in-pkts {
+ type oc-yang:counter64;
+ description
+ "The total number of IP packets received for the specified
+ address family, including those received in error";
+ reference
+ "RFC 4293 - Management Information Base for the
+ Internet Protocol (IP)";
+ }
+
+ leaf in-octets {
+ type oc-yang:counter64;
+ description
+ "The total number of octets received in input IP packets
+ for the specified address family, including those received
+ in error.";
+ reference
+ "RFC 4293 - Management Information Base for the
+ Internet Protocol (IP)";
+ }
+
+ leaf in-error-pkts {
+ // TODO: this counter combines several error conditions --
+ // could consider breaking them out to separate leaf nodes
+ type oc-yang:counter64;
+ description
+ "Number of IP packets discarded due to errors for the
+ specified address family, including errors in the IP
+ header, no route found to the IP destination, invalid
+ address, unknown protocol, etc.";
+ reference
+ "RFC 4293 - Management Information Base for the
+ Internet Protocol (IP)";
+ }
+
+ leaf in-forwarded-pkts {
+ type oc-yang:counter64;
+ description
+ "The number of input packets for which the device was not
+ their final IP destination and for which the device
+ attempted to find a route to forward them to that final
+ destination.";
+ reference
+ "RFC 4293 - Management Information Base for the
+ Internet Protocol (IP)";
+ }
+
+ leaf in-forwarded-octets {
+ type oc-yang:counter64;
+ description
+ "The number of octets received in input IP packets
+ for the specified address family for which the device was
+ not their final IP destination and for which the
+ device attempted to find a route to forward them to that
+ final destination.";
+ reference
+ "RFC 4293 - Management Information Base for the
+ Internet Protocol (IP)";
+ }
+
+ leaf in-discarded-pkts {
+ type oc-yang:counter64;
+ description
+ "The number of input IP packets for the
+ specified address family, for which no problems were
+ encountered to prevent their continued processing, but
+ were discarded (e.g., for lack of buffer space).";
+ reference
+ "RFC 4293 - Management Information Base for the
+ Internet Protocol (IP)";
+ }
+
+ leaf out-pkts {
+ type oc-yang:counter64;
+ description
+ "The total number of IP packets for the
+ specified address family that the device supplied
+ to the lower layers for transmission. This includes
+ packets generated locally and those forwarded by the
+ device.";
+ reference
+ "RFC 4293 - Management Information Base for the
+ Internet Protocol (IP)";
+ }
+
+ leaf out-octets {
+ type oc-yang:counter64;
+ description
+ "The total number of octets in IP packets for the
+ specified address family that the device
+ supplied to the lower layers for transmission. This
+ includes packets generated locally and those forwarded by
+ the device.";
+ reference
+ "RFC 4293 - Management Information Base for the
+ Internet Protocol (IP)";
+ }
+
+ leaf out-error-pkts {
+ // TODO: this counter combines several error conditions --
+ // could consider breaking them out to separate leaf nodes
+ type oc-yang:counter64;
+ description
+ "Number of IP packets for the specified address family
+ locally generated and discarded due to errors, including
+ no route found to the IP destination.";
+ reference
+ "RFC 4293 - Management Information Base for the
+ Internet Protocol (IP)";
+ }
+
+ leaf out-forwarded-pkts {
+ type oc-yang:counter64;
+ description
+ "The number of packets for which this entity was not their
+ final IP destination and for which it was successful in
+ finding a path to their final destination.";
+ reference
+ "RFC 4293 - Management Information Base for the
+ Internet Protocol (IP)";
+ }
+
+ leaf out-forwarded-octets {
+ type oc-yang:counter64;
+ description
+ "The number of octets in packets for which this entity was
+ not their final IP destination and for which it was
+ successful in finding a path to their final destination.";
+ reference
+ "RFC 4293 - Management Information Base for the
+ Internet Protocol (IP)";
+ }
+
+ leaf out-discarded-pkts {
+ type oc-yang:counter64;
+ description
+ "The number of output IP packets for the
+ specified address family for which no problem was
+ encountered to prevent their transmission to their
+ destination, but were discarded (e.g., for lack of
+ buffer space).";
+ reference
+ "RFC 4293 - Management Information Base for the
+ Internet Protocol (IP)";
+ }
+ }
+
+ }
+
+
+
+ grouping ipv4-global-config {
+ description
+ "Configuration data for IPv4 interfaces across
+ all addresses assigned to the interface";
+
+ leaf enabled {
+ type boolean;
+ default true;
+ description
+ "Controls whether IPv4 is enabled or disabled on this
+ interface. When IPv4 is enabled, this interface is
+ connected to an IPv4 stack, and the interface can send
+ and receive IPv4 packets.";
+ }
+
+ leaf mtu {
+ type uint16 {
+ range "68..max";
+ }
+ units octets;
+ description
+ "The size, in octets, of the largest IPv4 packet that the
+ interface will send and receive.
+
+ The server may restrict the allowed values for this leaf,
+ depending on the interface's type.
+
+ If this leaf is not configured, the operationally used MTU
+ depends on the interface's type.";
+ reference
+ "RFC 791: Internet Protocol";
+ }
+
+ uses ip-common-global-config;
+
+
+ }
+
+ grouping ipv4-address-config {
+
+ description
+ "Per IPv4 adresss configuration data for the
+ interface.";
+
+ leaf ip {
+ type oc-inet:ipv4-address;
+ description
+ "The IPv4 address on the interface.";
+ }
+
+ leaf prefix-length {
+ type uint8 {
+ range "0..32";
+ }
+ description
+ "The length of the subnet prefix.";
+ }
+ }
+
+ grouping ipv4-neighbor-config {
+ description
+ "Per IPv4 neighbor configuration data. Neighbor
+ entries are analagous to static ARP entries, i.e., they
+ create a correspondence between IP and link-layer addresses";
+
+ leaf ip {
+ type oc-inet:ipv4-address;
+ description
+ "The IPv4 address of the neighbor node.";
+ }
+ leaf link-layer-address {
+ type oc-yang:phys-address;
+ mandatory true;
+ description
+ "The link-layer address of the neighbor node.";
+ }
+ }
+
+ grouping ipv4-address-state {
+ description
+ "State variables for IPv4 addresses on the interface";
+
+ leaf origin {
+ type ip-address-origin;
+ description
+ "The origin of this address, e.g., statically configured,
+ assigned by DHCP, etc..";
+ }
+ }
+
+ grouping ipv4-neighbor-state {
+ description
+ "State variables for IPv4 neighbor entries on the interface.";
+
+ leaf origin {
+ type neighbor-origin;
+ description
+ "The origin of this neighbor entry, static or dynamic.";
+ }
+ }
+
+ grouping ipv6-global-config {
+ description
+ "Configuration data at the global level for each
+ IPv6 interface";
+
+ leaf enabled {
+ type boolean;
+ default true;
+ description
+ "Controls whether IPv6 is enabled or disabled on this
+ interface. When IPv6 is enabled, this interface is
+ connected to an IPv6 stack, and the interface can send
+ and receive IPv6 packets.";
+ }
+
+ leaf mtu {
+ type uint32 {
+ range "1280..max";
+ }
+ units octets;
+ description
+ "The size, in octets, of the largest IPv6 packet that the
+ interface will send and receive.
+
+ The server may restrict the allowed values for this leaf,
+ depending on the interface's type.
+
+ If this leaf is not configured, the operationally used MTU
+ depends on the interface's type.";
+ reference
+ "RFC 2460: Internet Protocol, Version 6 (IPv6) Specification
+ Section 5";
+ }
+
+ leaf dup-addr-detect-transmits {
+ type uint32;
+ default 1;
+ description
+ "The number of consecutive Neighbor Solicitation messages
+ sent while performing Duplicate Address Detection on a
+ tentative address. A value of zero indicates that
+ Duplicate Address Detection is not performed on
+ tentative addresses. A value of one indicates a single
+ transmission with no follow-up retransmissions.";
+ reference
+ "RFC 4862: IPv6 Stateless Address Autoconfiguration";
+ }
+
+ uses ip-common-global-config;
+ }
+
+ grouping ipv6-address-config {
+ description "Per-address configuration data for IPv6 interfaces";
+
+ leaf ip {
+ type oc-inet:ipv6-address;
+ description
+ "The IPv6 address on the interface.";
+ }
+
+ leaf prefix-length {
+ type uint8 {
+ range "0..128";
+ }
+ mandatory true;
+ description
+ "The length of the subnet prefix.";
+ }
+ }
+
+ grouping ipv6-address-state {
+ description
+ "Per-address operational state data for IPv6 interfaces";
+
+ leaf origin {
+ type ip-address-origin;
+ description
+ "The origin of this address, e.g., static, dhcp, etc.";
+ }
+
+ leaf status {
+ type enumeration {
+ enum PREFERRED {
+ description
+ "This is a valid address that can appear as the
+ destination or source address of a packet.";
+ }
+ enum DEPRECATED {
+ description
+ "This is a valid but deprecated address that should
+ no longer be used as a source address in new
+ communications, but packets addressed to such an
+ address are processed as expected.";
+ }
+ enum INVALID {
+ description
+ "This isn't a valid address, and it shouldn't appear
+ as the destination or source address of a packet.";
+ }
+ enum INACCESSIBLE {
+ description
+ "The address is not accessible because the interface
+ to which this address is assigned is not
+ operational.";
+ }
+ enum UNKNOWN {
+ description
+ "The status cannot be determined for some reason.";
+ }
+ enum TENTATIVE {
+ description
+ "The uniqueness of the address on the link is being
+ verified. Addresses in this state should not be
+ used for general communication and should only be
+ used to determine the uniqueness of the address.";
+ }
+ enum DUPLICATE {
+ description
+ "The address has been determined to be non-unique on
+ the link and so must not be used.";
+ }
+ enum OPTIMISTIC {
+ description
+ "The address is available for use, subject to
+ restrictions, while its uniqueness on a link is
+ being verified.";
+ }
+ }
+ description
+ "The status of an address. Most of the states correspond
+ to states from the IPv6 Stateless Address
+ Autoconfiguration protocol.";
+ reference
+ "RFC 4293: Management Information Base for the
+ Internet Protocol (IP)
+ - IpAddressStatusTC
+ RFC 4862: IPv6 Stateless Address Autoconfiguration";
+ }
+ }
+
+ grouping ipv6-neighbor-config {
+ description
+ "Per-neighbor configuration data for IPv6 interfaces";
+
+ leaf ip {
+ type oc-inet:ipv6-address;
+ description
+ "The IPv6 address of the neighbor node.";
+ }
+
+ leaf link-layer-address {
+ type oc-yang:phys-address;
+ mandatory true;
+ description
+ "The link-layer address of the neighbor node.";
+ }
+ }
+
+ grouping ipv6-neighbor-state {
+ description "Per-neighbor state variables for IPv6 interfaces";
+
+ leaf origin {
+ type neighbor-origin;
+ description
+ "The origin of this neighbor entry.";
+ }
+ leaf is-router {
+ type empty;
+ description
+ "Indicates that the neighbor node acts as a router.";
+ }
+ leaf neighbor-state {
+ type enumeration {
+ enum INCOMPLETE {
+ description
+ "Address resolution is in progress, and the link-layer
+ address of the neighbor has not yet been
+ determined.";
+ }
+ enum REACHABLE {
+ description
+ "Roughly speaking, the neighbor is known to have been
+ reachable recently (within tens of seconds ago).";
+ }
+ enum STALE {
+ description
+ "The neighbor is no longer known to be reachable, but
+ until traffic is sent to the neighbor no attempt
+ should be made to verify its reachability.";
+ }
+ enum DELAY {
+ description
+ "The neighbor is no longer known to be reachable, and
+ traffic has recently been sent to the neighbor.
+ Rather than probe the neighbor immediately, however,
+ delay sending probes for a short while in order to
+ give upper-layer protocols a chance to provide
+ reachability confirmation.";
+ }
+ enum PROBE {
+ description
+ "The neighbor is no longer known to be reachable, and
+ unicast Neighbor Solicitation probes are being sent
+ to verify reachability.";
+ }
+ }
+ description
+ "The Neighbor Unreachability Detection state of this
+ entry.";
+ reference
+ "RFC 4861: Neighbor Discovery for IP version 6 (IPv6)
+ Section 7.3.2";
+ }
+ }
+
+ grouping ip-vrrp-ipv6-config {
+ description
+ "IPv6-specific configuration data for VRRP on IPv6
+ interfaces";
+
+ leaf virtual-link-local {
+ type oc-inet:ip-address;
+ description
+ "For VRRP on IPv6 interfaces, sets the virtual link local
+ address";
+ }
+ }
+
+ grouping ip-vrrp-ipv6-state {
+ description
+ "IPv6-specific operational state for VRRP on IPv6 interfaces";
+
+ uses ip-vrrp-ipv6-config;
+ }
+
+ grouping ip-vrrp-tracking-config {
+ description
+ "Configuration data for tracking interfaces
+ in a VRRP group";
+
+ leaf-list track-interface {
+ type leafref {
+ path "/oc-if:interfaces/oc-if:interface/oc-if:name";
+ }
+ // TODO: we may need to add some restriction to ethernet
+ // or IP interfaces.
+ description
+ "Sets a list of one or more interfaces that should
+ be tracked for up/down events to dynamically change the
+ priority state of the VRRP group, and potentially
+ change the mastership if the tracked interface going
+ down lowers the priority sufficiently. Any of the tracked
+ interfaces going down will cause the priority to be lowered.
+ Some implementations may only support a single
+ tracked interface.";
+ }
+
+ leaf priority-decrement {
+ type uint8 {
+ range 0..254;
+ }
+ default 0;
+ description "Set the value to subtract from priority when
+ the tracked interface goes down";
+ }
+ }
+
+ grouping ip-vrrp-tracking-state {
+ description
+ "Operational state data for tracking interfaces in a VRRP
+ group";
+ }
+
+ grouping ip-vrrp-tracking-top {
+ description
+ "Top-level grouping for VRRP interface tracking";
+
+ container interface-tracking {
+ description
+ "Top-level container for VRRP interface tracking";
+
+ container config {
+ description
+ "Configuration data for VRRP interface tracking";
+
+ uses ip-vrrp-tracking-config;
+ }
+
+ container state {
+
+ config false;
+
+ description
+ "Operational state data for VRRP interface tracking";
+
+ uses ip-vrrp-tracking-config;
+ uses ip-vrrp-tracking-state;
+ }
+ }
+ }
+
+ grouping ip-vrrp-config {
+ description
+ "Configuration data for VRRP on IP interfaces";
+
+ leaf virtual-router-id {
+ type uint8 {
+ range 1..255;
+ }
+ description
+ "Set the virtual router id for use by the VRRP group. This
+ usually also determines the virtual MAC address that is
+ generated for the VRRP group";
+ }
+
+ leaf-list virtual-address {
+ type oc-inet:ip-address;
+ description
+ "Configure one or more virtual addresses for the
+ VRRP group";
+ }
+
+ leaf priority {
+ type uint8 {
+ range 1..254;
+ }
+ default 100;
+ description
+ "Specifies the sending VRRP interface's priority
+ for the virtual router. Higher values equal higher
+ priority";
+ }
+
+ leaf preempt {
+ type boolean;
+ default true;
+ description
+ "When set to true, enables preemption by a higher
+ priority backup router of a lower priority master router";
+ }
+
+ leaf preempt-delay {
+ type uint16 {
+ range 0..3600;
+ }
+ default 0;
+ description
+ "Set the delay the higher priority router waits
+ before preempting";
+ }
+
+ leaf accept-mode {
+ type boolean;
+ // TODO: should we adopt the RFC default given the common
+ // operational practice of setting to true?
+ default false;
+ description
+ "Configure whether packets destined for
+ virtual addresses are accepted even when the virtual
+ address is not owned by the router interface";
+ }
+
+ leaf advertisement-interval {
+ type uint16 {
+ range 1..4095;
+ }
+ // TODO this range is theoretical -- needs to be validated
+ // against major implementations.
+ units "centiseconds";
+ default 100;
+ description
+ "Sets the interval between successive VRRP
+ advertisements -- RFC 5798 defines this as a 12-bit
+ value expressed as 0.1 seconds, with default 100, i.e.,
+ 1 second. Several implementation express this in units of
+ seconds";
+ }
+ }
+
+ grouping ip-vrrp-state {
+ description
+ "Operational state data for VRRP on IP interfaces";
+
+ leaf current-priority {
+ type uint8;
+ description "Operational value of the priority for the
+ interface in the VRRP group";
+ }
+ }
+
+ grouping ip-vrrp-top {
+ description
+ "Top-level grouping for Virtual Router Redundancy Protocol";
+
+ container vrrp {
+ description
+ "Enclosing container for VRRP groups handled by this
+ IP interface";
+
+ reference "RFC 5798 - Virtual Router Redundancy Protocol
+ (VRRP) Version 3 for IPv4 and IPv6";
+
+ list vrrp-group {
+ key "virtual-router-id";
+ description
+ "List of VRRP groups, keyed by virtual router id";
+
+ leaf virtual-router-id {
+ type leafref {
+ path "../config/virtual-router-id";
+ }
+ description
+ "References the configured virtual router id for this
+ VRRP group";
+ }
+
+ container config {
+ description
+ "Configuration data for the VRRP group";
+
+ uses ip-vrrp-config;
+ }
+
+ container state {
+
+ config false;
+
+ description
+ "Operational state data for the VRRP group";
+
+ uses ip-vrrp-config;
+ uses ip-vrrp-state;
+ }
+
+ uses ip-vrrp-tracking-top;
+ }
+ }
+ }
+
+ grouping ipv4-top {
+ description "Top-level configuration and state for IPv4
+ interfaces";
+
+ container ipv4 {
+ description
+ "Parameters for the IPv4 address family.";
+
+ container addresses {
+ description
+ "Enclosing container for address list";
+
+ list address {
+ key "ip";
+ description
+ "The list of configured IPv4 addresses on the interface.";
+
+ leaf ip {
+ type leafref {
+ path "../oc-ip:config/oc-ip:ip";
+ }
+ description "References the configured IP address";
+ }
+
+ container config {
+ description "Configuration data for each configured IPv4
+ address on the interface";
+
+ uses ipv4-address-config;
+
+ }
+
+ container state {
+
+ config false;
+ description "Operational state data for each IPv4 address
+ configured on the interface";
+
+ uses ipv4-address-config;
+ uses ipv4-address-state;
+ }
+
+ }
+ }
+
+ container neighbors {
+ description
+ "Enclosing container for neighbor list";
+
+ list neighbor {
+ key "ip";
+ description
+ "A list of mappings from IPv4 addresses to
+ link-layer addresses.
+
+ Entries in this list are used as static entries in the
+ ARP Cache.";
+ reference
+ "RFC 826: An Ethernet Address Resolution Protocol";
+
+ leaf ip {
+ type leafref {
+ path "../oc-ip:config/oc-ip:ip";
+ }
+ description "References the configured IP address";
+ }
+
+ container config {
+ description "Configuration data for each configured IPv4
+ address on the interface";
+
+ uses ipv4-neighbor-config;
+
+ }
+
+ container state {
+
+ config false;
+ description "Operational state data for each IPv4 address
+ configured on the interface";
+
+ uses ipv4-neighbor-config;
+ uses ipv4-neighbor-state;
+ }
+ }
+ }
+
+ uses oc-if:sub-unnumbered-top;
+
+ container config {
+ description
+ "Top-level IPv4 configuration data for the interface";
+
+ uses ipv4-global-config;
+ }
+
+ container state {
+
+ config false;
+ description
+ "Top level IPv4 operational state data";
+
+ uses ipv4-global-config;
+ uses ip-common-counters-state;
+ }
+ }
+ }
+
+ grouping ipv6-top {
+ description
+ "Top-level configuration and state for IPv6 interfaces";
+
+ container ipv6 {
+ description
+ "Parameters for the IPv6 address family.";
+
+ container addresses {
+ description
+ "Enclosing container for address list";
+
+ list address {
+ key "ip";
+ description
+ "The list of configured IPv6 addresses on the interface.";
+
+ leaf ip {
+ type leafref {
+ path "../oc-ip:config/oc-ip:ip";
+ }
+ description "References the configured IP address";
+ }
+
+ container config {
+ description
+ "Configuration data for each IPv6 address on
+ the interface";
+
+ uses ipv6-address-config;
+
+ }
+
+ container state {
+
+ config false;
+ description
+ "State data for each IPv6 address on the
+ interface";
+
+ uses ipv6-address-config;
+ uses ipv6-address-state;
+ }
+ }
+ }
+
+ container neighbors {
+ description
+ "Enclosing container for list of IPv6 neighbors";
+
+ list neighbor {
+ key "ip";
+ description
+ "List of IPv6 neighbors";
+
+ leaf ip {
+ type leafref {
+ path "../oc-ip:config/oc-ip:ip";
+ }
+ description
+ "References the configured IP neighbor address";
+ }
+
+ container config {
+ description "Configuration data for each IPv6 address on
+ the interface";
+
+ uses ipv6-neighbor-config;
+
+ }
+
+ container state {
+
+ config false;
+ description "State data for each IPv6 address on the
+ interface";
+
+ uses ipv6-neighbor-config;
+ uses ipv6-neighbor-state;
+ }
+ }
+ }
+ uses oc-if:sub-unnumbered-top;
+
+ container config {
+ description "Top-level config data for the IPv6 interface";
+
+ uses ipv6-global-config;
+ }
+
+ container state {
+ config false;
+ description
+ "Top-level operational state data for the IPv6 interface";
+
+ uses ipv6-global-config;
+ uses ip-common-counters-state;
+
+ }
+ }
+ }
+
+ // augment statements
+
+ augment "/oc-if:interfaces/oc-if:interface/oc-if:subinterfaces/" +
+ "oc-if:subinterface" {
+ description
+ "IPv4 addr family configuration for
+ interfaces";
+
+ uses ipv4-top;
+
+ }
+
+ augment "/oc-if:interfaces/oc-if:interface/oc-if:subinterfaces/" +
+ "oc-if:subinterface" {
+ description
+ "IPv6 addr family configuration for
+ interfaces";
+
+ uses ipv6-top;
+
+ }
+
+ // VRRP for IPv4 interfaces
+
+ augment "/oc-if:interfaces/oc-if:interface/oc-if:subinterfaces/" +
+ "oc-if:subinterface/oc-ip:ipv4/oc-ip:addresses/oc-ip:address" {
+
+ description
+ "Additional IP addr family configuration for
+ interfaces";
+
+ uses ip-vrrp-top;
+
+ }
+
+ // VRRP for IPv6 interfaces
+
+ augment "/oc-if:interfaces/oc-if:interface/oc-if:subinterfaces/" +
+ "oc-if:subinterface/oc-ip:ipv6/oc-ip:addresses/oc-ip:address" {
+ description
+ "Additional IP addr family configuration for
+ interfaces";
+
+ uses ip-vrrp-top;
+
+ }
+
+ augment "/oc-if:interfaces/oc-if:interface/oc-if:subinterfaces/" +
+ "oc-if:subinterface/oc-ip:ipv6/oc-ip:addresses/oc-ip:address/" +
+ "vrrp/vrrp-group/config" {
+ description
+ "Additional VRRP data for IPv6 interfaces";
+
+ uses ip-vrrp-ipv6-config;
+ }
+
+ augment "/oc-if:interfaces/oc-if:interface/oc-if:subinterfaces/" +
+ "oc-if:subinterface/oc-ip:ipv6/oc-ip:addresses/oc-ip:address/vrrp/" +
+ "vrrp-group/state" {
+ description
+ "Additional VRRP data for IPv6 interfaces";
+
+ uses ip-vrrp-ipv6-state;
+ }
+
+ // Augments for for routed VLANs
+
+ augment "/oc-if:interfaces/oc-if:interface/oc-vlan:routed-vlan" {
+ description
+ "IPv4 addr family configuration for
+ interfaces";
+
+ uses ipv4-top;
+
+ }
+
+ augment "/oc-if:interfaces/oc-if:interface/oc-vlan:routed-vlan" {
+ description
+ "IPv6 addr family configuration for
+ interfaces";
+
+ uses ipv6-top;
+
+ }
+
+ // VRRP for routed VLAN interfaces
+
+ augment "/oc-if:interfaces/oc-if:interface/oc-vlan:routed-vlan/" +
+ "oc-ip:ipv4/oc-ip:addresses/oc-ip:address" {
+ description
+ "Additional IP addr family configuration for
+ interfaces";
+
+ uses ip-vrrp-top;
+
+ }
+
+ augment "/oc-if:interfaces/oc-if:interface/oc-vlan:routed-vlan/" +
+ "oc-ip:ipv6/oc-ip:addresses/oc-ip:address" {
+ description
+ "Additional IP addr family configuration for
+ interfaces";
+
+ uses ip-vrrp-top;
+
+ }
+
+ augment "/oc-if:interfaces/oc-if:interface/oc-vlan:routed-vlan/" +
+ "oc-ip:ipv6/oc-ip:addresses/oc-ip:address/vrrp/vrrp-group/config" {
+ description
+ "Additional VRRP data for IPv6 interfaces";
+
+ uses ip-vrrp-ipv6-config;
+ }
+
+
+ augment "/oc-if:interfaces/oc-if:interface/oc-vlan:routed-vlan/" +
+ "oc-ip:ipv6/oc-ip:addresses/oc-ip:address/vrrp/vrrp-group/state" {
+ description
+ "Additional VRRP data for IPv6 interfaces";
+
+ uses ip-vrrp-ipv6-state;
+ }
+
+ // rpc statements
+
+ // notification statements
+}
diff --git a/models/openconfig/src/main/yang/interfaces/openconfig-if-types.yang b/models/openconfig/src/main/yang/interfaces/openconfig-if-types.yang
new file mode 100644
index 0000000..dc447ef
--- /dev/null
+++ b/models/openconfig/src/main/yang/interfaces/openconfig-if-types.yang
@@ -0,0 +1,80 @@
+module openconfig-if-types {
+ yang-version "1";
+
+ namespace "http://openconfig.net/yang/openconfig-if-types";
+
+ prefix "oc-ift";
+
+ // import statements
+ import openconfig-extensions { prefix oc-ext; }
+
+ // meta
+ organization
+ "OpenConfig working group";
+
+ contact
+ "OpenConfig working group
+ netopenconfig@googlegroups.com";
+
+ description
+ "This module contains a set of interface type definitions that
+ are used across OpenConfig models. These are generally physical
+ or logical interfaces, distinct from hardware ports (which are
+ described by the OpenConfig platform model).";
+
+ oc-ext:openconfig-version "0.1.0";
+
+ revision "2016-11-14" {
+ description
+ "Initial version";
+ reference "0.1.0";
+ }
+
+
+ identity INTERFACE_TYPE {
+ description
+ "Base identity from which interface types are derived.";
+ }
+
+ identity IF_ETHERNET {
+ base INTERFACE_TYPE;
+ description
+ "Ethernet interfaces based on IEEE 802.3 standards, as well
+ as FlexEthernet";
+ reference
+ "IEEE 802.3-2015 - IEEE Standard for Ethernet
+ OIF Flex Ethernet Implementation Agreement 1.0";
+ }
+
+ identity IF_AGGREGATE {
+ base INTERFACE_TYPE;
+ description
+ "An aggregated, or bonded, interface forming a
+ Link Aggregation Group (LAG), or bundle, most often based on
+ the IEEE 802.1AX (or 802.3ad) standard.";
+ reference
+ "IEEE 802.1AX-2008";
+ }
+
+ identity IF_LOOPBACK {
+ base INTERFACE_TYPE;
+ description
+ "A virtual interface designated as a loopback used for
+ various management and operations tasks.";
+ }
+
+ identity IF_ROUTED_VLAN {
+ base INTERFACE_TYPE;
+ description
+ "A logical interface used for routing services on a VLAN.
+ Such interfaces are also known as switch virtual interfaces
+ (SVI) or integrated routing and bridging interfaces (IRBs).";
+ }
+
+ identity IF_SONET {
+ base INTERFACE_TYPE;
+ description
+ "SONET/SDH interface";
+ }
+
+}
diff --git a/models/openconfig/src/main/yang/interfaces/openconfig-interfaces.yang b/models/openconfig/src/main/yang/interfaces/openconfig-interfaces.yang
new file mode 100644
index 0000000..b5c928e
--- /dev/null
+++ b/models/openconfig/src/main/yang/interfaces/openconfig-interfaces.yang
@@ -0,0 +1,965 @@
+module openconfig-interfaces {
+
+ yang-version "1";
+
+ // namespace
+ namespace "http://openconfig.net/yang/interfaces";
+
+ prefix "oc-if";
+
+ // import some basic types
+ import ietf-interfaces { prefix ietf-if; }
+ import openconfig-yang-types { prefix oc-yang; }
+ import openconfig-types { prefix oc-types; }
+ import openconfig-extensions { prefix oc-ext; }
+
+ // meta
+ organization "OpenConfig working group";
+
+ contact
+ "OpenConfig working group
+ netopenconfig@googlegroups.com";
+
+ description
+ "Model for managing network interfaces and subinterfaces. This
+ module also defines convenience types / groupings for other
+ models to create references to interfaces:
+
+ base-interface-ref (type) - reference to a base interface
+ interface-ref (grouping) - container for reference to a
+ interface + subinterface
+ interface-ref-state (grouping) - container for read-only
+ (opstate) reference to interface + subinterface
+
+ This model reuses data items defined in the IETF YANG model for
+ interfaces described by RFC 7223 with an alternate structure
+ (particularly for operational state data) and with
+ additional configuration items.
+
+ Portions of this code were derived from IETF RFC 7223.
+ Please reproduce this note if possible.
+
+ IETF code is subject to the following copyright and license:
+ Copyright (c) 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).";
+
+ oc-ext:openconfig-version "2.0.0";
+
+ revision "2017-07-14" {
+ description
+ "Added Ethernet/IP state data; Add dhcp-client;
+ migrate to OpenConfig types modules; Removed or
+ renamed opstate values";
+ reference "2.0.0";
+ }
+
+ revision "2017-04-03" {
+ description
+ "Update copyright notice.";
+ reference "1.1.1";
+ }
+
+ revision "2016-12-22" {
+ description
+ "Fixes to Ethernet interfaces model";
+ reference "1.1.0";
+ }
+
+
+ // typedef statements
+
+ typedef base-interface-ref {
+ type leafref {
+ path "/oc-if:interfaces/oc-if:interface/oc-if:name";
+ }
+ description
+ "Reusable type for by-name reference to a base interface.
+ This type may be used in cases where ability to reference
+ a subinterface is not required.";
+ }
+
+ typedef interface-id {
+ type string;
+ description
+ "User-defined identifier for an interface, generally used to
+ name a interface reference. The id can be arbitrary but a
+ useful convention is to use a combination of base interface
+ name and subinterface index.";
+ }
+
+ // grouping statements
+
+ grouping interface-ref-common {
+ description
+ "Reference leafrefs to interface / subinterface";
+
+ leaf interface {
+ type leafref {
+ path "/oc-if:interfaces/oc-if:interface/oc-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 "/oc-if:interfaces/" +
+ "oc-if:interface[oc-if:name=current()/../interface]/" +
+ "oc-if:subinterfaces/oc-if:subinterface/oc-if:index";
+ }
+ 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.";
+ }
+ }
+
+ grouping interface-ref-state-container {
+ description
+ "Reusable opstate w/container for a reference to an
+ interface or subinterface";
+
+ container state {
+ config false;
+ description
+ "Operational state for interface-ref";
+
+ uses interface-ref-common;
+ }
+ }
+
+ grouping interface-ref {
+ description
+ "Reusable definition for a reference to an interface or
+ subinterface";
+
+ container interface-ref {
+ description
+ "Reference to an interface or subinterface";
+
+ container config {
+ description
+ "Configured reference to interface / subinterface";
+
+ uses interface-ref-common;
+ }
+
+ uses interface-ref-state-container;
+ }
+ }
+
+ grouping interface-ref-state {
+ description
+ "Reusable opstate w/container for a reference to an
+ interface or subinterface";
+
+ container interface-ref {
+ description
+ "Reference to an interface or subinterface";
+
+ uses interface-ref-state-container;
+ }
+ }
+
+ grouping base-interface-ref-state {
+ description
+ "Reusable opstate w/container for a reference to a
+ base interface (no subinterface).";
+
+ container state {
+ config false;
+ description
+ "Operational state for base interface reference";
+
+ leaf interface {
+ type base-interface-ref;
+ description
+ "Reference to a base interface.";
+ }
+ }
+ }
+
+
+ grouping interface-common-config {
+ description
+ "Configuration data data nodes common to physical interfaces
+ and subinterfaces";
+
+ leaf description {
+ type string;
+ description
+ "A textual description of the interface.
+
+ A server implementation MAY map this leaf to the ifAlias
+ MIB object. Such an implementation needs to use some
+ mechanism to handle the differences in size and characters
+ allowed between this leaf and ifAlias. The definition of
+ such a mechanism is outside the scope of this document.
+
+ Since ifAlias is defined to be stored in non-volatile
+ storage, the MIB implementation MUST map ifAlias to the
+ value of 'description' in the persistently stored
+ datastore.
+
+ Specifically, if the device supports ':startup', when
+ ifAlias is read the device MUST return the value of
+ 'description' in the 'startup' datastore, and when it is
+ written, it MUST be written to the 'running' and 'startup'
+ datastores. Note that it is up to the implementation to
+
+ decide whether to modify this single leaf in 'startup' or
+ perform an implicit copy-config from 'running' to
+ 'startup'.
+
+ If the device does not support ':startup', ifAlias MUST
+ be mapped to the 'description' leaf in the 'running'
+ datastore.";
+ reference
+ "RFC 2863: The Interfaces Group MIB - ifAlias";
+ }
+
+ leaf enabled {
+ type boolean;
+ default "true";
+ description
+ "This leaf contains the configured, desired state of the
+ interface.
+
+ Systems that implement the IF-MIB use the value of this
+ leaf in the 'running' datastore to set
+ IF-MIB.ifAdminStatus to 'up' or 'down' after an ifEntry
+ has been initialized, as described in RFC 2863.
+
+ Changes in this leaf in the 'running' datastore are
+ reflected in ifAdminStatus, but if ifAdminStatus is
+ changed over SNMP, this leaf is not affected.";
+ reference
+ "RFC 2863: The Interfaces Group MIB - ifAdminStatus";
+ }
+
+ }
+
+ grouping interface-phys-config {
+ description
+ "Configuration data for physical interfaces";
+
+ leaf name {
+ type string;
+ description
+ "The name of the interface.
+
+ A device MAY restrict the allowed values for this leaf,
+ possibly depending on the type of the interface.
+ For system-controlled interfaces, this leaf is the
+ device-specific name of the interface. The 'config false'
+ list interfaces/interface[name]/state contains the currently
+ existing interfaces on the device.
+
+ If a client tries to create configuration for a
+ system-controlled interface that is not present in the
+ corresponding state list, the server MAY reject
+ the request if the implementation does not support
+ pre-provisioning of interfaces or if the name refers to
+ an interface that can never exist in the system. A
+ NETCONF server MUST reply with an rpc-error with the
+ error-tag 'invalid-value' in this case.
+
+ The IETF model in RFC 7223 provides YANG features for the
+ following (i.e., pre-provisioning and arbitrary-names),
+ however they are omitted here:
+
+ If the device supports pre-provisioning of interface
+ configuration, the 'pre-provisioning' feature is
+ advertised.
+
+ If the device allows arbitrarily named user-controlled
+ interfaces, the 'arbitrary-names' feature is advertised.
+
+ When a configured user-controlled interface is created by
+ the system, it is instantiated with the same name in the
+ /interfaces/interface[name]/state list.";
+ }
+
+ leaf type {
+ type identityref {
+ base ietf-if:interface-type;
+ }
+ mandatory true;
+ description
+ "The type of the interface.
+
+ When an interface entry is created, a server MAY
+ initialize the type leaf with a valid value, e.g., if it
+ is possible to derive the type from the name of the
+ interface.
+
+ If a client tries to set the type of an interface to a
+ value that can never be used by the system, e.g., if the
+ type is not supported or if the type does not match the
+ name of the interface, the server MUST reject the request.
+ A NETCONF server MUST reply with an rpc-error with the
+ error-tag 'invalid-value' in this case.";
+ reference
+ "RFC 2863: The Interfaces Group MIB - ifType";
+ }
+
+ leaf mtu {
+ type uint16;
+ description
+ "Set the max transmission unit size in octets
+ for the physical interface. If this is not set, the mtu is
+ set to the operational default -- e.g., 1514 bytes on an
+ Ethernet interface.";
+ }
+
+ uses interface-common-config;
+ }
+
+ grouping interface-phys-holdtime-config {
+ description
+ "Configuration data for interface hold-time settings --
+ applies to physical interfaces.";
+
+ leaf up {
+ type uint32;
+ units milliseconds;
+ default 0;
+ description
+ "Dampens advertisement when the interface
+ transitions from down to up. A zero value means dampening
+ is turned off, i.e., immediate notification.";
+ }
+
+ leaf down {
+ type uint32;
+ units milliseconds;
+ default 0;
+ description
+ "Dampens advertisement when the interface transitions from
+ up to down. A zero value means dampening is turned off,
+ i.e., immediate notification.";
+ }
+ }
+
+ grouping interface-phys-holdtime-state {
+ description
+ "Operational state data for interface hold-time.";
+ }
+
+ grouping interface-phys-holdtime-top {
+ description
+ "Top-level grouping for setting link transition
+ dampening on physical and other types of interfaces.";
+
+ container hold-time {
+ description
+ "Top-level container for hold-time settings to enable
+ dampening advertisements of interface transitions.";
+
+ container config {
+ description
+ "Configuration data for interface hold-time settings.";
+
+ uses interface-phys-holdtime-config;
+ }
+
+ container state {
+
+ config false;
+
+ description
+ "Operational state data for interface hold-time.";
+
+ uses interface-phys-holdtime-config;
+ uses interface-phys-holdtime-state;
+ }
+ }
+ }
+
+ grouping interface-common-state {
+ description
+ "Operational state data (in addition to intended configuration)
+ at the global level for this interface";
+
+ leaf ifindex {
+ type uint32;
+ description
+ "System assigned number for each interface. Corresponds to
+ ifIndex object in SNMP Interface MIB";
+ reference
+ "RFC 2863 - The Interfaces Group MIB";
+ }
+
+ leaf admin-status {
+ type enumeration {
+ enum UP {
+ description
+ "Ready to pass packets.";
+ }
+ enum DOWN {
+ description
+ "Not ready to pass packets and not in some test mode.";
+ }
+ enum TESTING {
+ //TODO: This is generally not supported as a configured
+ //admin state, though it's in the standard interfaces MIB.
+ //Consider removing it.
+ description
+ "In some test mode.";
+ }
+ }
+ //TODO:consider converting to an identity to have the
+ //flexibility to remove some values defined by RFC 7223 that
+ //are not used or not implemented consistently.
+ mandatory true;
+ description
+ "The desired state of the interface. In RFC 7223 this leaf
+ has the same read semantics as ifAdminStatus. Here, it
+ reflects the administrative state as set by enabling or
+ disabling the interface.";
+ reference
+ "RFC 2863: The Interfaces Group MIB - ifAdminStatus";
+ }
+
+ leaf oper-status {
+ type enumeration {
+ enum UP {
+ value 1;
+ description
+ "Ready to pass packets.";
+ }
+ enum DOWN {
+ value 2;
+ description
+ "The interface does not pass any packets.";
+ }
+ enum TESTING {
+ value 3;
+ description
+ "In some test mode. No operational packets can
+ be passed.";
+ }
+ enum UNKNOWN {
+ value 4;
+ description
+ "Status cannot be determined for some reason.";
+ }
+ enum DORMANT {
+ value 5;
+ description
+ "Waiting for some external event.";
+ }
+ enum NOT_PRESENT {
+ value 6;
+ description
+ "Some component (typically hardware) is missing.";
+ }
+ enum LOWER_LAYER_DOWN {
+ value 7;
+ description
+ "Down due to state of lower-layer interface(s).";
+ }
+ }
+ //TODO:consider converting to an identity to have the
+ //flexibility to remove some values defined by RFC 7223 that
+ //are not used or not implemented consistently.
+ mandatory true;
+ description
+ "The current operational state of the interface.
+
+ This leaf has the same semantics as ifOperStatus.";
+ reference
+ "RFC 2863: The Interfaces Group MIB - ifOperStatus";
+ }
+
+ leaf last-change {
+ type oc-types:timeticks64;
+ units nanoseconds;
+ description
+ "This timestamp indicates the time of the last state change
+ of the interface (e.g., up-to-down transition). This
+ corresponds to the ifLastChange object in the standard
+ interface MIB.
+
+ The value is the timestamp in nanoseconds relative to
+ the Unix Epoch (Jan 1, 1970 00:00:00 UTC).";
+ reference
+ "RFC 2863: The Interfaces Group MIB - ifLastChange";
+ }
+
+ }
+
+
+ grouping interface-counters-state {
+ description
+ "Operational state representing interface counters
+ and statistics.";
+
+ //TODO: we may need to break this list of counters into those
+ //that would appear for physical vs. subinterface or logical
+ //interfaces. For now, just replicating the full stats
+ //grouping to both interface and subinterface.
+
+ container counters {
+ description
+ "A collection of interface-related statistics objects.";
+
+ leaf in-octets {
+ type oc-yang:counter64;
+ description
+ "The total number of octets received on the interface,
+ including framing characters.
+
+ Discontinuities in the value of this counter can occur
+ at re-initialization of the management system, and at
+ other times as indicated by the value of
+ 'last-clear'.";
+ reference
+ "RFC 2863: The Interfaces Group MIB - ifHCInOctets";
+ }
+
+ leaf in-unicast-pkts {
+ type oc-yang:counter64;
+ description
+ "The number of packets, delivered by this sub-layer to a
+ higher (sub-)layer, that were not addressed to a
+ multicast or broadcast address at this sub-layer.
+
+ Discontinuities in the value of this counter can occur
+ at re-initialization of the management system, and at
+ other times as indicated by the value of
+ 'last-clear'.";
+ reference
+ "RFC 2863: The Interfaces Group MIB - ifHCInUcastPkts";
+ }
+
+ leaf in-broadcast-pkts {
+ type oc-yang:counter64;
+ description
+ "The number of packets, delivered by this sub-layer to a
+ higher (sub-)layer, that were addressed to a broadcast
+ address at this sub-layer.
+
+ Discontinuities in the value of this counter can occur
+ at re-initialization of the management system, and at
+ other times as indicated by the value of
+ 'last-clear'.";
+ reference
+ "RFC 2863: The Interfaces Group MIB -
+ ifHCInBroadcastPkts";
+ }
+
+ leaf in-multicast-pkts {
+ type oc-yang:counter64;
+ description
+ "The number of packets, delivered by this sub-layer to a
+ higher (sub-)layer, that were addressed to a multicast
+ address at this sub-layer. For a MAC-layer protocol,
+ this includes both Group and Functional addresses.
+
+ Discontinuities in the value of this counter can occur
+ at re-initialization of the management system, and at
+ other times as indicated by the value of
+ 'last-clear'.";
+ reference
+ "RFC 2863: The Interfaces Group MIB -
+ ifHCInMulticastPkts";
+ }
+
+ leaf in-discards {
+ type oc-yang:counter64;
+ description
+ "The number of inbound packets that were chosen to be
+ discarded even though no errors had been detected to
+ prevent their being deliverable to a higher-layer
+ protocol. One possible reason for discarding such a
+ packet could be to free up buffer space.
+
+ Discontinuities in the value of this counter can occur
+ at re-initialization of the management system, and at
+ other times as indicated by the value of
+ 'last-clear'.";
+
+
+ reference
+ "RFC 2863: The Interfaces Group MIB - ifInDiscards";
+ }
+
+ leaf in-errors {
+ type oc-yang:counter64;
+ description
+ "For packet-oriented interfaces, the number of inbound
+ packets that contained errors preventing them from being
+ deliverable to a higher-layer protocol. For character-
+ oriented or fixed-length interfaces, the number of
+ inbound transmission units that contained errors
+ preventing them from being deliverable to a higher-layer
+ protocol.
+
+ Discontinuities in the value of this counter can occur
+ at re-initialization of the management system, and at
+ other times as indicated by the value of
+ 'last-clear'.";
+ reference
+ "RFC 2863: The Interfaces Group MIB - ifInErrors";
+ }
+
+ leaf in-unknown-protos {
+ type oc-yang:counter64;
+ description
+ "For packet-oriented interfaces, the number of packets
+ received via the interface that were discarded because
+ of an unknown or unsupported protocol. For
+ character-oriented or fixed-length interfaces that
+ support protocol multiplexing, the number of
+ transmission units received via the interface that were
+ discarded because of an unknown or unsupported protocol.
+ For any interface that does not support protocol
+ multiplexing, this counter is not present.
+
+ Discontinuities in the value of this counter can occur
+ at re-initialization of the management system, and at
+ other times as indicated by the value of
+ 'last-clear'.";
+ reference
+ "RFC 2863: The Interfaces Group MIB - ifInUnknownProtos";
+ }
+
+ leaf in-fcs-errors {
+ type oc-yang:counter64;
+ description
+ "Number of received packets which had errors in the
+ frame check sequence (FCS), i.e., framing errors.
+
+ Discontinuities in the value of this counter can occur
+ when the device is re-initialization as indicated by the
+ value of 'last-clear'.";
+ }
+
+ leaf out-octets {
+ type oc-yang:counter64;
+ description
+ "The total number of octets transmitted out of the
+ interface, including framing characters.
+
+ Discontinuities in the value of this counter can occur
+ at re-initialization of the management system, and at
+ other times as indicated by the value of
+ 'last-clear'.";
+ reference
+ "RFC 2863: The Interfaces Group MIB - ifHCOutOctets";
+ }
+
+ leaf out-unicast-pkts {
+ type oc-yang:counter64;
+ description
+ "The total number of packets that higher-level protocols
+ requested be transmitted, and that were not addressed
+ to a multicast or broadcast address at this sub-layer,
+ including those that were discarded or not sent.
+
+ Discontinuities in the value of this counter can occur
+ at re-initialization of the management system, and at
+ other times as indicated by the value of
+ 'last-clear'.";
+ reference
+ "RFC 2863: The Interfaces Group MIB - ifHCOutUcastPkts";
+ }
+
+ leaf out-broadcast-pkts {
+ type oc-yang:counter64;
+ description
+ "The total number of packets that higher-level protocols
+ requested be transmitted, and that were addressed to a
+ broadcast address at this sub-layer, including those
+ that were discarded or not sent.
+
+ Discontinuities in the value of this counter can occur
+ at re-initialization of the management system, and at
+ other times as indicated by the value of
+ 'last-clear'.";
+ reference
+ "RFC 2863: The Interfaces Group MIB -
+ ifHCOutBroadcastPkts";
+ }
+
+
+ leaf out-multicast-pkts {
+ type oc-yang:counter64;
+ description
+ "The total number of packets that higher-level protocols
+ requested be transmitted, and that were addressed to a
+ multicast address at this sub-layer, including those
+ that were discarded or not sent. For a MAC-layer
+ protocol, this includes both Group and Functional
+ addresses.
+
+ Discontinuities in the value of this counter can occur
+ at re-initialization of the management system, and at
+ other times as indicated by the value of
+ 'last-clear'.";
+ reference
+ "RFC 2863: The Interfaces Group MIB -
+ ifHCOutMulticastPkts";
+ }
+
+ leaf out-discards {
+ type oc-yang:counter64;
+ description
+ "The number of outbound packets that were chosen to be
+ discarded even though no errors had been detected to
+ prevent their being transmitted. One possible reason
+ for discarding such a packet could be to free up buffer
+ space.
+
+ Discontinuities in the value of this counter can occur
+ at re-initialization of the management system, and at
+ other times as indicated by the value of
+ 'last-clear'.";
+ reference
+ "RFC 2863: The Interfaces Group MIB - ifOutDiscards";
+ }
+
+ leaf out-errors {
+ type oc-yang:counter64;
+ description
+ "For packet-oriented interfaces, the number of outbound
+ packets that could not be transmitted because of errors.
+ For character-oriented or fixed-length interfaces, the
+ number of outbound transmission units that could not be
+ transmitted because of errors.
+
+ Discontinuities in the value of this counter can occur
+ at re-initialization of the management system, and at
+ other times as indicated by the value of
+ 'last-clear'.";
+ reference
+ "RFC 2863: The Interfaces Group MIB - ifOutErrors";
+ }
+
+ leaf carrier-transitions {
+ type oc-yang:counter64;
+ description
+ "Number of times the interface state has transitioned
+ between up and down since the time the device restarted
+ or the last-clear time, whichever is most recent.";
+ }
+
+ leaf last-clear {
+ type oc-types:timeticks64;
+ units nanoseconds;
+ description
+ "Timestamp of the last time the interface counters were
+ cleared.
+
+ The value is the timestamp in nanoseconds relative to
+ the Unix Epoch (Jan 1, 1970 00:00:00 UTC).";
+ }
+ }
+ }
+
+ // data definition statements
+
+ grouping sub-unnumbered-config {
+ description
+ "Configuration data for unnumbered subinterfaces";
+
+ leaf enabled {
+ type boolean;
+ default false;
+ description
+ "Indicates that the subinterface is unnumbered. By default
+ the subinterface is numbered, i.e., expected to have an
+ IP address configuration.";
+ }
+ }
+
+ grouping sub-unnumbered-state {
+ description
+ "Operational state data unnumbered subinterfaces";
+ }
+
+ grouping sub-unnumbered-top {
+ description
+ "Top-level grouping unnumbered subinterfaces";
+
+ container unnumbered {
+ description
+ "Top-level container for setting unnumbered interfaces.
+ Includes reference the interface that provides the
+ address information";
+
+ container config {
+ description
+ "Configuration data for unnumbered interface";
+
+ uses sub-unnumbered-config;
+ }
+
+ container state {
+
+ config false;
+
+ description
+ "Operational state data for unnumbered interfaces";
+
+ uses sub-unnumbered-config;
+ uses sub-unnumbered-state;
+ }
+
+ uses oc-if:interface-ref;
+ }
+ }
+
+ grouping subinterfaces-config {
+ description
+ "Configuration data for subinterfaces";
+
+ leaf index {
+ type uint32;
+ default 0;
+ description
+ "The index of the subinterface, or logical interface number.
+ On systems with no support for subinterfaces, or not using
+ subinterfaces, this value should default to 0, i.e., the
+ default subinterface.";
+ }
+
+ uses interface-common-config;
+
+ }
+
+ grouping subinterfaces-state {
+ description
+ "Operational state data for subinterfaces";
+
+ leaf name {
+ type string;
+ description
+ "The system-assigned name for the sub-interface. This MAY
+ be a combination of the base interface name and the
+ subinterface index, or some other convention used by the
+ system.";
+ }
+
+ uses interface-common-state;
+ uses interface-counters-state;
+ }
+
+ grouping subinterfaces-top {
+ description
+ "Subinterface data for logical interfaces associated with a
+ given interface";
+
+ container subinterfaces {
+ description
+ "Enclosing container for the list of subinterfaces associated
+ with a physical interface";
+
+ list subinterface {
+ key "index";
+
+ description
+ "The list of subinterfaces (logical interfaces) associated
+ with a physical interface";
+
+ leaf index {
+ type leafref {
+ path "../config/index";
+ }
+ description
+ "The index number of the subinterface -- used to address
+ the logical interface";
+ }
+
+ container config {
+ description
+ "Configurable items at the subinterface level";
+
+ uses subinterfaces-config;
+ }
+
+ container state {
+
+ config false;
+ description
+ "Operational state data for logical interfaces";
+
+ uses subinterfaces-config;
+ uses subinterfaces-state;
+ }
+ }
+ }
+ }
+
+ grouping interfaces-top {
+ description
+ "Top-level grouping for interface configuration and
+ operational state data";
+
+ container interfaces {
+ description
+ "Top level container for interfaces, including configuration
+ and state data.";
+
+
+ list interface {
+ key "name";
+
+ description
+ "The list of named interfaces on the device.";
+
+ leaf name {
+ type leafref {
+ path "../config/name";
+ }
+ description
+ "References the configured name of the interface";
+ //TODO: need to consider whether this should actually
+ //reference the name in the state subtree, which
+ //presumably would be the system-assigned name, or the
+ //configured name. Points to the config/name now
+ //because of YANG 1.0 limitation that the list
+ //key must have the same "config" as the list, and
+ //also can't point to a non-config node.
+ }
+
+ container config {
+ description
+ "Configurable items at the global, physical interface
+ level";
+
+ uses interface-phys-config;
+ }
+
+ container state {
+
+ config false;
+ description
+ "Operational state data at the global interface level";
+
+ uses interface-phys-config;
+ uses interface-common-state;
+ uses interface-counters-state;
+ }
+
+ uses interface-phys-holdtime-top;
+ uses subinterfaces-top;
+ }
+ }
+ }
+
+ uses interfaces-top;
+
+
+}