netconfcentral logo

example-ietf-interfaces-common

HTML

example-ietf-interfaces-common@2017-06-27



  module example-ietf-interfaces-common {

    yang-version 1.1;

    namespace
      "urn:ietf:params:xml:ns:yang:example-ietf-interfaces-common";

    prefix if-cmn;

    import ietf-interfaces {
      prefix if;
    }
    import iana-if-type {
      prefix ianaift;
    }
    import iana-if-property-type {
      prefix ianaifp;
    }

    organization
      "IETF NETMOD (NETCONF Data Modeling Language) Working Group";

    contact
      "WG Web:   <http://tools.ietf.org/wg/netmod/>
     WG List:  <mailto:netmod@ietf.org>

     WG Chair: Lou Berger
               <mailto:lberger@labn.net>

     WG Chair: Kent Watsen
               <mailto:kwatsen@juniper.net>

     Editor:   Robert Wilton
               <mailto:rwilton@cisco.com>";

    description
      "Example of using when statements with interface properties";

    revision "2017-06-27" {
      description
        "Examples of using when statements with interface properties";
      reference
        "Internet draft: draft-ietf-netmod-intf-ext-yang-04";

    }


    feature bandwidth {
      description "<description elided>";
      reference
        "Section 3.1 Bandwidth";

    }

    feature carrier-delay {
      description "<description elided>";
      reference
        "Section 3.2 Carrier Delay";

    }

    feature dampening {
      description "<description elided>";
      reference
        "Section 3.3 Dampening";

    }

    feature loopback {
      description "<description elided>";
      reference
        "Section 3.5 Loopback";

    }

    feature configurable-l2-mtu {
      description "<description elided>";
      reference
        "Section 3.6 MTU";

    }

    feature sub-interfaces {
      description
        "This feature indicates that the device supports the
       instantiation of sub-interfaces.  Sub-interfaces are defined
       as logical child interfaces that allow features and forwarding
       decisions to be applied to a subset of the traffic processed
       on the specified parent interface.";
      reference
        "Section 3.7 Sub-interface";

    }

    feature forwarding-mode {
      description "<description elided>";
      reference
        "Section 3.8 Forwarding Mode";

    }

    identity loopback {
      base 
      description
        "Base identity for interface loopback options";
    }

    identity loopback-internal {
      base loopback;
      description "<description elided>";
    }

    identity loopback-line {
      base loopback;
      description "<description elided>";
    }

    identity loopback-connector {
      base loopback;
      description "<description elided>";
    }

    augment /if:interfaces/if:interface {
      description
        "Augments the IETF interface model with optional common
       interface level commands that are not formally covered by any
       specific standard";
      container encapsulation {
        when
          "derived-from-or-self(../if:type, 'ianaifp:ethernet-like') or
         derived-from-or-self(../if:type, 'ianaifp:sub-interface')" {
          description
            "All interface types that can have a configurable L2
           encapsulation";
        }
        description
          "Holds the OSI layer 2 encapsulation associated with an
         interface";
        choice encaps-type {
          description
            "Extensible choice of L2 encapsulations";
        }  // choice encaps-type
      }  // container encapsulation

      leaf loopback {
        when
          "derived-from(if:type, 'ianaifp:physical')" {
          description
            "Applies to all interfaces that derive from the physical
           interface property.";
        }
        if-feature loopback;
        type identityref {
          base loopback;
        }
        description
          "Enables traffic loopback.";
      }

      leaf l2-mtu {
        if-feature configurable-l2-mtu;
        type uint16 {
          range "64 .. 65535";
        }
        description
          "The maximum size of layer 2 frames that may be transmitted
         or received on the interface (excluding any FCS overhead).
         In the case of Ethernet interfaces it also excludes the
         4-8 byte overhead of any known (i.e. explicitly matched by
         a child sub-interface) 801.1Q VLAN tags.";
      }
    }

    augment /if:interfaces/if:interface {
      when
        "derived-from(if:type, 'ianaifp:sub-interface')" {
        description
          "Applies to all interfaces that derive from the Ethernet-like
         interface property.";
      }
      if-feature sub-interfaces;
      description
        "Add a parent interface field to interfaces that model
       sub-interfaces";
      leaf parent-interface {
        type if:interface-ref;
        mandatory true;
        description
          "This is the reference to the parent interface of this
         sub-interface.";
      }
    }
  }  // module example-ietf-interfaces-common

Summary

  
  
Organization IETF NETMOD (NETCONF Data Modeling Language) Working Group
  
Module example-ietf-interfaces-common
Version 2017-06-27
File example-ietf-interfaces-common@2017-06-27.yang
  
Prefix if-cmn
Namespace urn:ietf:params:xml:ns:yang:example-ietf-interfaces-common
  
Cooked /cookedmodules/example-ietf-interfaces-common/2017-06-27
YANG /src/example-ietf-interfaces-common@2017-06-27.yang
XSD /xsd/example-ietf-interfaces-common@2017-06-27.xsd
  
Abstract Example of using when statements with interface properties
  
Contact
WG Web:   <http://tools.ietf.org/wg/netmod/>
WG List:  <mailto:netmod@ietf.org>

WG Chair: Lou Berger
	  <mailto:lberger@labn.net>

WG Chair: Kent Watsen
	  <mailto:kwatsen@juniper.net>

Editor:   Robert Wilton
	  <mailto:rwilton@cisco.com>

Description

 
Example of using when statements with interface properties