module ieee802-types {
  namespace urn:ieee:std:802.1Q:yang:ieee802-types;
  prefix ieee;
  organization
    "IEEE 802.1 Working Group";
  contact
    "WG-URL: http://ieee802.org/1/
    WG-EMail: stds-802-1-l@ieee.org
    
    Contact: IEEE 802.1 Working Group Chair
    Postal: C/O IEEE 802.1 Working Group
           IEEE Standards Association
           445 Hoes Lane
           Piscataway, NJ 08854
           USA
    
    E-mail: stds-802-1-chairs@ieee.org";
  description
    "This module contains a collection of generally useful derived data
    types for IEEE YANG models.
    
    Copyright (C) IEEE (2022).
    
    This version of this YANG module is part of IEEE Std 802.1Q; see the
    standard itself for full legal notices.";
  revision 2022-05-19 {
    description
      "Published as part of IEEE Std 802.1Q-2022.";
    reference
      "IEEE Std 802.1Q-2022, Bridges and Bridged Networks.";
  }
  revision 2021-08-25 {
    description
      "Published as part of IEEE Std 802.1ABcu";
    reference
      "IEEE Std 802.1AB-2016";
  }
  revision 2020-06-04 {
    description
      "Published as part of IEEE Std 802.1Qcx-2020. Second version.";
    reference
      "IEEE Std 802.1Qcx-2020, Bridges and Bridged Networks - YANG Data
      Model for Connectivity Fault Management.";
  }
  revision 2018-03-07 {
    description
      "Published as part of IEEE Std 802.1Q-2018. Initial version.";
    reference
      "IEEE Std 802.1Q-2018, Bridges and Bridged Networks.";
  }
  typedef mac-address {
    type string {
      pattern "[0-9a-fA-F]{2}(-[0-9a-fA-F]{2}){5}";
    }
    description
      "The mac-address type represents a MAC address in the canonical
      format and hexadecimal format specified by IEEE Std 802. The
      hexidecimal representation uses uppercase characters.";
    reference
      "3.1, 8.1 of IEEE Std 802-2014";
  }
  typedef chassis-id-subtype-type {
    type enumeration {
      enum chassis-component {
        value 1;
        description
          "Represents a chassis identifier based on the value of
          entPhysicalAlias object (defined in IETF RFC 2737) for a
          chassis component (i.e., an entPhysicalClass value of
          chassis(3))";
      }
      enum interface-alias {
        value 2;
        description
          "Represents a chassis identifier based on the value of ifAlias
          object (defined in IETF RFC 2863) for an interface on the
          containing chassis.";
      }
      enum port-component {
        value 3;
        description
          "Represents a chassis identifier based on the value of
          entPhysicalAlias object (defined in IETF RFC 2737) for a port
          or backplane component (i.e., entPhysicalClass value of
          port(10) or backplane(4)), within the containing chassis.";
      }
      enum mac-address {
        value 4;
        description
          "Represents a chassis identifier based on the value of a
          unicast source address (encoded in network byte order and IEEE
          802.3 canonical bit order), of a port on the containing
          chassis as defined in IEEE Std 802-2001.";
      }
      enum network-address {
        value 5;
        description
          "Represents a chassis identifier based on a network address,
          associated with a particular chassis. The encoded address is
          actually composed of two fields. The first field is a single
          octet, representing the IANA AddressFamilyNumbers value for
          the specific address type, and the second field is the network
          address value.";
      }
      enum interface-name {
        value 6;
        description
          "Represents a chassis identifier based on the value of ifName
          object (defined in IETF RFC 2863) for an interface on the
          containing chassis.";
      }
      enum local {
        value 7;
        description
          "Represents a chassis identifier based on a locally defined
          value.";
      }
    }
    description
      "The source of a chassis identifier.";
    reference
      "IEEE Std 802-2014;" +
      "IETF RFC 2737;" +
      "IETF RFC 2863";
  }
  typedef chassis-id-type {
    type string {
      length "1..255";
    }
    description
      "The format of a chassis identifier string. Objects of this type
      are always used with an associated lldp-chassis-is-subtype object,
      which identifies the format of the particular lldp-chassis-id
      object instance.
      
      If the associated lldp-chassis-id-subtype object has a value of
      chassis-component, then the octet string identifies a particular
      instance of the entPhysicalAlias object (defined in IETF RFC 2737)
      for a chassis component (i.e., an entPhysicalClass value of
      chassis(3)).
      
      If the associated lldp-chassis-id-subtype object has a value of
      interface-alias, then the octet string identifies a particular
      instance of the ifAlias object (defined in IETF RFC 2863) for an
      interface on the containing chassis. If the particular ifAlias
      object does not contain any values, another chassis identifier
      type should be used.
      
      If the associated lldp-chassis-id-subtype object has a value of
      port-component, then the octet string identifies a particular
      instance of the entPhysicalAlias object (defined in IETF RFC 2737)
      for a port or backplane component within the containing chassis.
      
      If the associated lldp-chassis-id-subtype object has a value of
      mac-address, then this string identifies a particular unicast
      source address (encoded in network byte order and IEEE 802.3
      canonical bit order), of a port on the containing chassis as
      defined in IEEE Std 802-2001.
      
      If the associated lldp-chassis-id-subtype object has a value of
      network-address, then this string identifies a particular network
      address, encoded in network byte order, associated with one or
      more ports on the containing chassis. The first octet contains the
      IANA Address Family Numbers enumeration value for the specific
      address type, and octets 2 through N contain the network address
      value in network byte order.
      
      If the associated lldp-chassis-id-subtype object has a value of
      interface-name, then the octet string identifies a particular
      instance of the ifName object (defined in IETF RFC 2863) for an
      interface on the containing chassis. If the particular ifName
      object does not contain any values, another chassis identifier
      type should be used.
      
      If the associated lldp-chassis-id-subtype object has a value of
      local, then this string identifies a locally assigned Chassis ID.";
    reference
      "IEEE Std 802-2014;" +
      "IETF RFC 2737;" +
      "IETF RFC 2863";
  }
  typedef port-id-subtype-type {
    type enumeration {
      enum interface-alias {
        value 1;
        description
          "Represents a port identifier based on the ifAlias MIB object,
          defined in IETF RFC 2863.";
      }
      enum port-component {
        value 2;
        description
          "Represents a port identifier based on the value of
          entPhysicalAlias (defined in IETF RFC 2737) for a port
          component (i.e., entPhysicalClass value of port(10)), within
          the containing chassis.";
      }
      enum mac-address {
        value 3;
        description
          "Represents a port identifier based on a unicast source
          address (encoded in network byte order and IEEE 802.3
          canonical bit order), which has been detected by the agent and
          associated with a particular port (IEEE Std 802-2001).";
      }
      enum network-address {
        value 4;
        description
          "Represents a port identifier based on a network address,
          detected by the agent and associated with a particular port.";
      }
      enum interface-name {
        value 5;
        description
          "Represents a port identifier based on the ifName MIB object,
          defined in IETF RFC 2863.";
      }
      enum agent-circuit-id {
        value 6;
        description
          "Represents a port identifier based on the agent-local
          identifier of the circuit (defined in RFC 3046), detected by
          the agent and associated with a particular port.";
      }
      enum local {
        value 7;
        description
          "Represents a port identifier based on a value locally
          assigned.";
      }
    }
    description
      "The source of a particular type of port identifier used in the
      LLDP YANG module.";
  }
  typedef port-id-type {
    type string {
      length "1..255";
    }
    description
      "The format of a port identifier string. Objects of this type are
      always used with an associated port-id-subtype object, which
      identifies the format of the particular lldp-port-id object
      instance.
      
      If the associated port-id-subtype object has a value of
      interface-alias, then the octet string identifies a particular
      instance of the ifAlias object (defined in IETF RFC 2863). If the
      particular ifAlias object does not contain any values, another
      port identifier type should be used.
      
      If the associated port-id-subtype object has a value of
      port-component, then the octet string identifies a particular
      instance of the entPhysicalAlias object (defined in IETF RFC 2737)
      for a port or backplane component.
      
      If the associated port-id-subtype object has a value of
      mac-address, then this string identifies a particular unicast
      source address (encoded in network byte order and IEEE 802.3
      canonical bit order) associated with the port (IEEE Std 802-2001).
      
      If the associated port-id-subtype object has a value of
      network-address, then this string identifies a network address
      associated with the port. The first octet contains the IANA
      AddressFamilyNumbers enumeration value for the specific address
      type, and octets 2 through N contain the networkAddress address
      value in network byte order.
      
      If the associated port-id-subtype object has a value of
      interface-name, then the octet string identifies a particular
      instance of the ifName object (defined in IETF RFC 2863). If the
      particular ifName object does not contain any values, another port
      identifier type should be used.
      
      If the associated port-id-subtype object has a value of
      agent-circuit-id, then this string identifies a agent-local
      identifier of the circuit (defined in RFC 3046).
      
      If the associated port-id-subtype object has a value of
      local, then this string identifies a locally assigned port ID.";
    reference
      "IEEE Std 802-2014;" +
      "IETF RFC 2737;" +
      "IETF RFC 2863," +
      "IETF RFC 3046";
  }
}
