module ieee802-types {

  namespace "urn:ieee:std:802:yang:ieee802-types";
  prefix "ieee";

  organization
    "Institute of Electrical and Electronics Engineers";

  contact
    "Web URL: http://www.ieee802.org/1/

      Editor:
        Marc Holness
        mholness@ciena.com";

  description
    "This module contains a collection of generally useful derived
    data types for IEEE YANG models.";

  revision "2016-07-24" {
    description
      "Make updates based upon comment resolution based upon
      draft D0.4 of P802.1Qcp.";
    reference
      "IEEE 802.1Q-2014, Media Access Control (MAC) Bridges and
      Virtual Bridged Local Area Networks.";
  }
  revision "2016-05-11" {
    description
      "Make updates based upon comment resolution from Jan2016
      IEEE 802 Interim meeting.";
    reference
      "IEEE 802.1Q-2014, Media Access Control (MAC) Bridges and
      Virtual Bridged Local Area Networks.";
  }

  revision 2015-09-10 {
    description
      "Initial revision.";
    reference
      "IEEE 802";
  }

  /*
   * Collection of IEEE address type definitions
   */

  typedef mac-address {
    type string {
      pattern '[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}';
    }
    description
      "The mac-address type represents an 802 MAC address represented
      in the canonical order defined by IEEE 802. The canonical
    	representation uses lowercase characters.
    	
    	In the value set and its semantics, this type if equivalent to
    	the MacAddress textual convention of the SMIv2.";
    reference
      "IEEE 802.3-2012, Clause 3.2.3
    	 RFC 2579: Textual Conventions for SMIv2";
  }

  /*
   * Collection of IEEE 802 related identifier types
   */

  typedef vlanid {
    type uint16 {
      range "1..4094";
    }
    description
      "The vlanid type uniquely identifies a VLAN. This is the 12-bit
      VLAN-ID used in the VLAN Tag header. The range is defined by
      the referenced specification. This type is in the value set and
      its semantics equivalent to the VlanId textual convention of
      the SMIv2.";
    reference
      "IEEE Std 802.1Q-2014: Virtual Bridged Local Area Networks.";
  }

}
