module infix-lldp {
  yang-version 1.1;
  namespace "urn:infix:lldp:ns:yang:1.0";
  prefix infix-lldp;

  import ieee802-dot1ab-lldp {
    prefix lldp;
  }

  organization "KernelKit";
  contact      "kernelkit@googlegroups.com";
  description  "Infix augments and deviations to ieee-dot1ab-lldp.";

  revision 2025-05-05 {
    description 
      "Restrict 'dest-mac-address' to only allow the LLDP multicast MAC
       address (01:80:C2:00:00:0E).";
    reference "internal";
  }

  revision 2025-01-08 {
    description "Enable std. /lldp:lldp/message-tx-interval";
  }

  revision 2023-08-23 {
    description "Initial revision.";
    reference "internal";
  }

  /*
   * Data nodes
   */

  augment "/lldp:lldp" {
    description "Augment of ieee802-dot1ab-lldp with a global enabled flag.";
    leaf enabled {
      type boolean;
      description "Globally enable or disable IEEE 802.1ab LLDP agent.";
    }
  }

  deviation "/lldp:lldp/lldp:port/lldp:dest-mac-address" {
    deviate replace {
      type string {
        pattern "([0-9a-fA-F]{2}:){5}[0-9a-fA-F]{2}";
      }
    }
  }

  deviation "/lldp:lldp/lldp:port/lldp:dest-mac-address" {
    deviate add {
      must "translate(., 'abcdef', 'ABCDEF') = '01:80:C2:00:00:0E'" {
        error-message "Only the LLDP Multicast MAC (01:80:C2:00:00:0E) is allowed.";
      }
    }
  }

  deviation "/lldp:lldp/lldp:message-fast-tx" {
    deviate not-supported;
  }
  deviation "/lldp:lldp/lldp:message-tx-hold-multiplier" {
    deviate not-supported;
  }
  deviation "/lldp:lldp/lldp:notification-interval" {
    deviate not-supported;
  }
  deviation "/lldp:lldp/lldp:reinit-delay" {
    deviate not-supported;
  }
  deviation "/lldp:lldp/lldp:tx-credit-max" {
    deviate not-supported;
  }
  deviation "/lldp:lldp/lldp:tx-fast-init" {
    deviate not-supported;
  }
  
  
  deviation "/lldp:lldp/lldp:port/lldp:notification-enable" {
    deviate not-supported;
  }
  deviation "/lldp:lldp/lldp:port/lldp:tlvs-tx-enable" {
    deviate not-supported;
  }
  deviation "/lldp:lldp/lldp:port/lldp:management-address-tx-port" {
    deviate not-supported;
  }
  deviation "/lldp:lldp/lldp:port/lldp:port-id-subtype" {
    deviate not-supported;
  }
  deviation "/lldp:lldp/lldp:port/lldp:port-id" {
    deviate not-supported;
  }
  deviation "/lldp:lldp/lldp:port/lldp:port-desc" {
    deviate not-supported;
  }
  deviation "/lldp:lldp/lldp:port/lldp:tx-statistics" {
    deviate not-supported;
  }
  deviation "/lldp:lldp/lldp:port/lldp:rx-statistics" {
    deviate not-supported;
  }
  
  deviation "/lldp:lldp/lldp:port/lldp:message-fast-tx" {
    deviate not-supported;
  }
  deviation "/lldp:lldp/lldp:port/lldp:message-tx-hold-multiplier" {
    deviate not-supported;
  }
  deviation "/lldp:lldp/lldp:port/lldp:message-tx-interval" {
    deviate not-supported;
  }
  deviation "/lldp:lldp/lldp:port/lldp:notification-interval" {
    deviate not-supported;
  }
  deviation "/lldp:lldp/lldp:port/lldp:reinit-delay" {
    deviate not-supported;
  }
  deviation "/lldp:lldp/lldp:port/lldp:tx-credit-max" {
    deviate not-supported;
  }
  deviation "/lldp:lldp/lldp:port/lldp:tx-fast-init" {
    deviate not-supported;
  }
}
