Scott Baker | 4fb4ba9 | 2022-01-14 13:52:01 -0800 | [diff] [blame] | 1 | // SPDX-FileCopyrightText: 2021 Open Networking Foundation |
| 2 | // |
| 3 | // SPDX-License-Identifier: LicenseRef-ONF-Member-Only-1.0 |
| 4 | |
| 5 | submodule 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 Condon | 9f7966e | 2022-02-03 10:55:06 +0000 | [diff] [blame] | 36 | key "priority-traffic-rule-id"; |
Scott Baker | 4fb4ba9 | 2022-01-14 13:52:01 -0800 | [diff] [blame] | 37 | unique "device endpoint"; |
| 38 | description |
| 39 | "List of priority traffic rules"; |
| 40 | |
Sean Condon | 9f7966e | 2022-02-03 10:55:06 +0000 | [diff] [blame] | 41 | leaf priority-traffic-rule-id { |
Scott Baker | 4fb4ba9 | 2022-01-14 13:52:01 -0800 | [diff] [blame] | 42 | type priority-traffic-rule-id; |
| 43 | description "ID for this priority traffic class."; |
| 44 | } |
| 45 | |
Sean Condon | 9f7966e | 2022-02-03 10:55:06 +0000 | [diff] [blame] | 46 | uses at:desc-display-name; |
Scott Baker | 4fb4ba9 | 2022-01-14 13:52:01 -0800 | [diff] [blame] | 47 | |
| 48 | leaf device { |
| 49 | type leafref { |
Sean Condon | 9f7966e | 2022-02-03 10:55:06 +0000 | [diff] [blame] | 50 | path "../../../device/device-id"; |
Scott Baker | 4fb4ba9 | 2022-01-14 13:52:01 -0800 | [diff] [blame] | 51 | } |
| 52 | mandatory true; |
| 53 | description |
| 54 | "Link to device"; |
| 55 | } |
| 56 | |
Sean Condon | 24297da | 2022-01-27 09:50:34 +0000 | [diff] [blame] | 57 | leaf application { |
| 58 | type leafref { |
Sean Condon | 9f7966e | 2022-02-03 10:55:06 +0000 | [diff] [blame] | 59 | path "../../../../application/application-id"; |
Sean Condon | 24297da | 2022-01-27 09:50:34 +0000 | [diff] [blame] | 60 | } |
| 61 | mandatory true; |
| 62 | description |
| 63 | "Link to application"; |
| 64 | } |
| 65 | |
Scott Baker | 4fb4ba9 | 2022-01-14 13:52:01 -0800 | [diff] [blame] | 66 | leaf endpoint { |
| 67 | type leafref { |
Sean Condon | 9f7966e | 2022-02-03 10:55:06 +0000 | [diff] [blame] | 68 | path "../../../../application/endpoint/endpoint-id"; |
Scott Baker | 4fb4ba9 | 2022-01-14 13:52:01 -0800 | [diff] [blame] | 69 | } |
| 70 | mandatory true; |
| 71 | description |
Sean Condon | 24297da | 2022-01-27 09:50:34 +0000 | [diff] [blame] | 72 | "Link to endpoint in application"; |
Scott Baker | 4fb4ba9 | 2022-01-14 13:52:01 -0800 | [diff] [blame] | 73 | } |
| 74 | |
Sean Condon | 9f7966e | 2022-02-03 10:55:06 +0000 | [diff] [blame] | 75 | 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 Baker | 4fb4ba9 | 2022-01-14 13:52:01 -0800 | [diff] [blame] | 82 | } |
Sean Condon | 9f7966e | 2022-02-03 10:55:06 +0000 | [diff] [blame] | 83 | case gbr-case { |
| 84 | container gbr { |
| 85 | description "Per-Device per-Application GBR (Guaranteed BitRate) in bps"; |
| 86 | uses bitrate; |
| 87 | } |
Scott Baker | 4fb4ba9 | 2022-01-14 13:52:01 -0800 | [diff] [blame] | 88 | } |
| 89 | } |
| 90 | |
| 91 | leaf traffic-class { |
| 92 | type leafref { |
Sean Condon | 9f7966e | 2022-02-03 10:55:06 +0000 | [diff] [blame] | 93 | path "../../../../traffic-class/traffic-class-id"; |
Scott Baker | 4fb4ba9 | 2022-01-14 13:52:01 -0800 | [diff] [blame] | 94 | } |
| 95 | description |
| 96 | "Link to traffic class"; |
| 97 | } |
Scott Baker | 4fb4ba9 | 2022-01-14 13:52:01 -0800 | [diff] [blame] | 98 | } |
| 99 | } |
Sean Condon | 9f7966e | 2022-02-03 10:55:06 +0000 | [diff] [blame] | 100 | |
| 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 Baker | 4fb4ba9 | 2022-01-14 13:52:01 -0800 | [diff] [blame] | 115 | } |