module example-bridge {
  yang-version 1.1;
  namespace "http://example.com/ns/example-bridge";
  prefix example;

  import ietf-network-bridge {
    prefix netbr;
  }
  import ietf-network-bridge-scheduler {
    prefix sched;
  }

  organization
    "example.com";
  description
    "Example of bridge.";

  revision 2018-07-17 {
    description
      "For the sake of portability commented out
       double bases for identities since
       this is not supported by ODL Berillium.";
  }

  identity video0 {
    base sched:traffic-class;
  }

  identity video1 {
    base sched:traffic-class;
  }

  identity signaling {
    base sched:traffic-class;
  }

  identity best-effort {
    base sched:traffic-class;
  }

  identity default-port {
    base sched:port-class;
  }


  //Strict priority aggregator with 3 classes:
  identity strict-priority-aggregator {
    base sched:aggregator;
  }

  identity pri0 {
    base sched:shared-queue-aggregator-input;
    //base strict-priority-aggregator;
  }

  identity pri1 {
    base sched:shared-queue-aggregator-input;
    //base strict-priority-aggregator;
  }

  identity pri2 {
    base sched:shared-queue-aggregator-input;
    //base strict-priority-aggregator;
  }

  //Cyclic timeslot schedule aggregator with 2 timeslots:
  identity cyclic-timeslot-schedule-aggregator {
    base sched:aggregator;
  }

  identity timeslot0 {
    base sched:shared-queue-aggregator-input;
   // base cyclic-timeslot-schedule-aggregator;
  }

  identity timeslot1 {
    base sched:shared-queue-aggregator-input;
    //base cyclic-timeslot-schedule-aggregator;
  }

  augment "/netbr:bridge/sched:scheduler-classes/sched:scheduler-class"
    + "/sched:gate-controllers/sched:gate-controller" {
    when "./sched:type = 'example:cyclic-timeslot-schedule-aggregator'";
    leaf period {
      type uint32;
      units "nanoseconds";
    }
    leaf time-slot0-interval {
      type uint32;
      units "nanoseconds";
    }
    leaf time-slot1-interval {
      type uint32;
      units "nanoseconds";
    }
  }

  //Rate limiter - filter:
  identity rate-limiter {
    base sched:filter;
  }

  identity in {
    base sched:filter-input;
    base rate-limiter;
  }

  augment "/netbr:bridge/sched:scheduler-classes/sched:scheduler-class"
    + "/sched:gate-controllers/sched:gate-controller" {
    when "./sched:type = 'example:rate-limiter'";
    leaf interval {
      type uint32;
      units "nanoseconds";
    }
    leaf limit {
      type uint32;
      units "octets";
    }
  }
}
