netconfcentral logo

ietf-ethernet-segment@2017-03-13



  module ietf-ethernet-segment {

    yang-version 1;

    namespace
      "urn:ietf:params:xml:ns:yang:ietf-ethernet-segment";

    prefix es;

    import ietf-yang-types {
      prefix yang;
    }
    import ietf-inet-types {
      prefix inet;
    }
    import ietf-routing-types {
      prefix rt-types;
    }

    organization "ietf";

    contact "ietf";

    description "ethernet segment";

    revision "2017-03-13" {
      description
        " - Updated to use BGP parameters from "
          + "   ietf-routing-types.yang instead of from "
          + "   ietf-evpn.yang "
          + "";
      reference
        "";

    }

    revision "2016-07-08" {
      description
        "   - Added the configuration option to enable or "
          + "     disable per-EVI/EAD route "
          + "   - Added PBB parameter backbone-src-mac "
          + "   - Added operational state branch, initially "
          + "     to match the configuration branch"
          + "";
      reference
        "";

    }

    revision "2016-06-23" {
      description "WG document adoption";
      reference
        "";

    }

    revision "2015-10-15" {
      description "Initial revision";
      reference
        "";

    }


    feature ethernet-segment-bgp-params {
      description
        "Ethernet segment's BGP parameters";
    }

    feature ethernet-segment-pbb-params {
      description
        "Ethernet segment's PBB parameters";
    }

    typedef status-type {
      type enumeration {
        enum "up" {
          value 0;
          description "Status is up";
        }
        enum "down" {
          value 1;
          description "Status is down";
        }
      }
      description "status type";
    }

    container ethernet-segments {
      description "ethernet-segment";
      list ethernet-segment {
        key "name";
        description "An ethernet segment";
        leaf name {
          type string;
          description
            "Name of the ethernet segment";
        }

        choice ac-or-pw {
          description "ac-or-pw";
          leaf ac {
            type string;
            description
              "Eventual reference to standard "
                + "attachment circuit definition";
          }
          leaf pw {
            type string;
            description
              "Eventual reference to standard "
                + "pseudowire definition";
          }
        }  // choice ac-or-pw

        leaf ethernet-segment-identifier {
          type uint32;
          description
            "Ethernet segment identifier (esi)";
        }

        choice active-mode {
          mandatory true;
          description
            "Choice of active mode";
          leaf single-active-mode {
            type empty;
            description "single-active-mode";
          }
          leaf all-active-mode {
            type empty;
            description "all-active-mode";
          }
        }  // choice active-mode

        container pbb-parameters {
          if-feature ethernet-segment-pbb-params;
          description "PBB configuration";
          leaf backbone-src-mac {
            type yang:mac-address;
            description
              "backbone-src-mac, only if this is a PBB";
          }
        }  // container pbb-parameters

        container bgp-parameters {
          description "BGP parameters";
          container common {
            description
              "BGP parameters common to all pseudowires";
            list rd-rt {
              if-feature ethernet-segment-bgp-params;
              key "route-distinguisher";
              description
                "A list of route distinguishers and "
                  + "corresponding VPN route targets";
              leaf route-distinguisher {
                type rt-types:route-distinguisher;
                description
                  "Route distinguisher";
              }

              uses rt-types:vpn-route-targets;
            }  // list rd-rt
          }  // container common
        }  // container bgp-parameters

        container df-election {
          description "df-election";
          choice df-election-method {
            description
              "Choice of df election method";
            leaf hrw {
              type boolean;
              description
                "Enable (TRUE) or disable (FALSE) "
                  + "highest random weight";
            }
          }  // choice df-election-method

          leaf election-wait-time {
            type uint32;
            description "election-wait-time";
          }
        }  // container df-election

        leaf ead-evi-route {
          type boolean;
          default 'false';
          description
            "Enable (true) or disable (false) ead-evi-route";
        }
      }  // list ethernet-segment
    }  // container ethernet-segments

    container ethernet-segments-state {
      config false;
      description
        "Ethernet segmet operational state";
      list ethernet-segment-state {
        key "name";
        description "An ethernet segment";
        leaf name {
          type string;
          description
            "Name of the ethernet segment";
        }

        leaf service-type {
          type string;
          description "service-type";
        }

        leaf status {
          type status-type;
          description
            "Ethernet segment status";
        }

        choice ac-or-pw {
          description "ac-or-pw";
          leaf ac {
            type string;
            description
              "Name of attachment circuit";
          }
          leaf pw {
            type string;
            description "Name of pseudowire";
          }
        }  // choice ac-or-pw

        leaf interface-status {
          type status-type;
          description "interface status";
        }

        leaf ethernet-segment-identifier {
          type uint32;
          description
            "Ethernet segment identifier (esi)";
        }

        leaf active-mode {
          type string;
          description
            "Single-active-mode/all-active-mode";
        }

        container pbb-parameters {
          if-feature ethernet-segment-pbb-params;
          description "PBB configuration";
          leaf backbone-src-mac {
            type yang:mac-address;
            description
              "backbone-src-mac, only if this is a PBB";
          }
        }  // container pbb-parameters

        container bgp-parameters {
          description "BGP parameters";
          container common {
            description
              "BGP parameters common to all pseudowires";
            list rd-rt {
              if-feature ethernet-segment-bgp-params;
              key "route-distinguisher";
              description
                "A list of route distinghishers and "
                  + "corresponding route targets";
              leaf route-distinguisher {
                type rt-types:route-distinguisher;
                description
                  "Route distinguisher";
              }

              uses rt-types:vpn-route-targets;
            }  // list rd-rt
          }  // container common
        }  // container bgp-parameters

        container df-election {
          description "df-election";
          leaf hrw-enabled {
            type boolean;
            description
              "hrw-enabled is enabled (TRUE) "
                + "or disabled (FALSE)";
          }

          leaf election-wait-time {
            type uint32;
            description "election-wait-time";
          }
        }  // container df-election

        leaf ead-evi-route-enabled {
          type boolean;
          description
            "ead-evi-route is enabled (TRUE) "
              + "or disabled (FALSE)";
        }

        leaf esi-label {
          type string;
          description "esi-label";
        }

        list member {
          description
            "member of the ethernet segment";
          leaf ip-address {
            type inet:ip-address;
            description "ip-address";
          }
        }  // list member

        list df {
          description
            "df of an evpn instance's vlan";
          leaf service-identifier {
            type uint32;
            description "service-identifier";
          }

          leaf vlan {
            type uint32;
            description "vlan";
          }

          leaf ip-address {
            type inet:ip-address;
            description "ip-address";
          }
        }  // list df
      }  // list ethernet-segment-state
    }  // container ethernet-segments-state
  }  // module ietf-ethernet-segment