blob: e73cdf7f1d3d600ad4f3d04209fe2dfdd5029484 [file] [log] [blame]
Scott Baker4fb4ba92022-01-14 13:52:01 -08001// SPDX-FileCopyrightText: 2021 Open Networking Foundation
2//
3// SPDX-License-Identifier: LicenseRef-ONF-Member-Only-1.0
4
5submodule onf-priority-traffic-rule {
6 belongs-to onf-enterprise { prefix ent; }
7
8 import ietf-yang-types{ prefix yg; }
9 import onf-aether-types{ prefix at; }
10 include onf-device;
11 include onf-traffic-class;
12 include onf-application;
13
14 organization "Open Networking Foundation.";
15 contact "Scott Baker";
16 description
17 "The aether traffic class associates qos constants
18 with a named class of service";
19
20 revision "2022-01-19" {
21 description "An Aether Priority Traffic Rule";
22 reference "RFC 6087";
23 }
24
25 typedef priority-traffic-rule-id {
26 type yg:yang-identifier {
27 length 1..32;
28 }
29 description "The typedef for priority traffic rule id";
30 }
31
32 grouping priority-traffic-rule {
33 description "The top level container";
34
35 list priority-traffic-rule {
Sean Condon9f7966e2022-02-03 10:55:06 +000036 key "priority-traffic-rule-id";
Scott Baker4fb4ba92022-01-14 13:52:01 -080037 unique "device endpoint";
38 description
39 "List of priority traffic rules";
40
Sean Condon9f7966e2022-02-03 10:55:06 +000041 leaf priority-traffic-rule-id {
Scott Baker4fb4ba92022-01-14 13:52:01 -080042 type priority-traffic-rule-id;
43 description "ID for this priority traffic class.";
44 }
45
Sean Condon9f7966e2022-02-03 10:55:06 +000046 uses at:desc-display-name;
Scott Baker4fb4ba92022-01-14 13:52:01 -080047
48 leaf device {
49 type leafref {
Sean Condon9f7966e2022-02-03 10:55:06 +000050 path "../../../device/device-id";
Scott Baker4fb4ba92022-01-14 13:52:01 -080051 }
52 mandatory true;
53 description
54 "Link to device";
55 }
56
Sean Condon24297da2022-01-27 09:50:34 +000057 leaf application {
58 type leafref {
Sean Condon9f7966e2022-02-03 10:55:06 +000059 path "../../../../application/application-id";
Sean Condon24297da2022-01-27 09:50:34 +000060 }
61 mandatory true;
62 description
63 "Link to application";
64 }
65
Scott Baker4fb4ba92022-01-14 13:52:01 -080066 leaf endpoint {
67 type leafref {
Sean Condon9f7966e2022-02-03 10:55:06 +000068 path "../../../../application/endpoint/endpoint-id";
Scott Baker4fb4ba92022-01-14 13:52:01 -080069 }
70 mandatory true;
71 description
Sean Condon24297da2022-01-27 09:50:34 +000072 "Link to endpoint in application";
Scott Baker4fb4ba92022-01-14 13:52:01 -080073 }
74
Sean Condon9f7966e2022-02-03 10:55:06 +000075 choice bitrate {
76 description "Either an GBR or an MBR can be specified, but not both";
77 case mbr-case {
78 container mbr {
79 description "Per-Device per-Application MBR (Maximum BitRate) in bps";
80 uses bitrate;
81 }
Scott Baker4fb4ba92022-01-14 13:52:01 -080082 }
Sean Condon9f7966e2022-02-03 10:55:06 +000083 case gbr-case {
84 container gbr {
85 description "Per-Device per-Application GBR (Guaranteed BitRate) in bps";
86 uses bitrate;
87 }
Scott Baker4fb4ba92022-01-14 13:52:01 -080088 }
89 }
90
91 leaf traffic-class {
92 type leafref {
Sean Condon9f7966e2022-02-03 10:55:06 +000093 path "../../../../traffic-class/traffic-class-id";
Scott Baker4fb4ba92022-01-14 13:52:01 -080094 }
95 description
96 "Link to traffic class";
97 }
Scott Baker4fb4ba92022-01-14 13:52:01 -080098 }
99 }
Sean Condon9f7966e2022-02-03 10:55:06 +0000100
101 grouping bitrate {
102 description "uplink and downlink leafs for GBR and MBR";
103 leaf uplink {
104 type at:bitrate;
105 units bps;
106 description "Per-Device per-Application uplink data rate in bps";
107 }
108
109 leaf downlink {
110 type at:bitrate;
111 units bps;
112 description "Per-Device per application downlink data rate in bps";
113 }
114 }
Scott Baker4fb4ba92022-01-14 13:52:01 -0800115}