module ietf-network-bridge {
  namespace "urn:ietf:params:xml:ns:yang:ietf-network-bridge";
  prefix netbr;

  import ietf-interfaces {
    prefix if;
  }

  organization
    "IETF NETMOD (NETCONF Data Modeling Language) Working Group";
  contact
    "WG Web:   <http://tools.ietf.org/wg/netmod/>
     WG List:  <mailto:netmod@ietf.org>

     Editor:   Vladimir Vassilev
               <mailto:vladimir@lightside-instruments.com>";
  description
    "This module contains a collection of YANG definitions for
     description and management of network bridges.

     Copyright (c) 2020 IETF Trust and the persons identified as
     authors of the code. All rights reserved.

     Redistribution and use in source and binary forms, with or
     without modification, is permitted pursuant to, and subject
     to the license terms contained in, the Simplified BSD
     License set forth in Section 4.c of the IETF Trust's
     Legal Provisions Relating to IETF Documents
     (http://trustee.ietf.org/license-info).

     This version of this YANG module is part of RFC XXXX; see
     the RFC itself for full legal notices.";

  revision 2021-02-17 {
    description
      "Initial revision.";
    reference
      "RFC XXXX: Network Bridge";
  }

  typedef port-ref {
    type leafref {
      path "/if:interfaces/if:interface/netbr:port-name";
    }
    description
      "This type is used by data models that need to reference
       configured bridge ports.";
  }

  augment "/if:interfaces/if:interface" {
    description
      "Bridge port specific data.";
    leaf port-name {
      type leafref {
        path "/netbr:bridge/netbr:ports/netbr:port/netbr:name";
      }
      description
        "Reference to the bridge port";
    }
  }

  container bridge {
    description
      "Bridge parameters.";
    container ports {
      description
        "Member ports.";
      list port {
        key "name";
        unique "index";
        description
          "The list of bridge ports on the device.";
        leaf name {
          type string;
          description
            "Name of the port.";
        }
        leaf index {
          type uint64;
          description
            "Index of the port.";
        }
      }
    }
  }
}
