Remove "response" from yang.
[packetcable.git] / packetcable-policy-model / src / main / yang / packetcable.yang
1 module packetcable
2 {
3     namespace "urn:packetcable";
4     prefix "pcmm";
5
6     import ietf-yang-types      { prefix yang; }
7     import ietf-inet-types      { prefix inet; }
8
9     description "This module contains the PCMM Converged Cable Access Platform (CCAP) definitions";
10     organization "OpenDaylight Project";
11
12     revision 2015-03-27 {
13         description "Initial revision of PCMM CCAP definitions";
14     }
15
16
17         // Global typedefs
18         typedef service-class-name {
19         type string { length "2..16"; }
20         description "The Service Class Name is MUST be 2-16 bytes.";
21     }
22     typedef service-flow-direction {
23             type enumeration {
24                       enum us {
25                         value "1";
26                         description "Upstream service flow.";
27                       }
28                       enum ds {
29                         value "2";
30                         description "Downstream service flow.";
31                       }
32                 }
33         description "This value represents the service flow direction.";
34         }
35         typedef tp-protocol {
36                 type uint16 {range "0..257";}
37             description "This value represents the IP transport protocol (or Next Header) where 256 is any protocol and 257 is TCP or UDP";
38          }
39          typedef tos-byte {
40                 type uint8;
41                 description "TOS/TC byte or mask";
42          }
43
44
45         // CCAP devices
46         container ccap {
47                 list ccaps {
48                         description "
49                                 CCAP devices are known by their network name which is any string.
50                                 Each CCAP device has a network address:port, a list of subscriber IP subnets,
51                                 and a list of available Service Class Names.
52                                 ";
53                     key "ccapId";
54                         leaf ccapId {
55                             type string;
56                                 description "CCAP Identity";
57                             }
58                     uses ccap-attributes;
59             }
60     }
61
62         grouping ccap-attributes {
63                 description "
64                         Each CCAP device has a COPS connection address:port,
65                         a list of subscriber IP subnets, and
66                         a list of available Service Class Names.
67                         ";
68                 container connection {
69                         leaf ipAddress {
70                         type inet:ip-address;
71                         description "IP Address of CCAP";
72                 }
73                 leaf port {
74                         type inet:port-number;
75                         description "COPS session TCP port number";
76                         default 3918;
77                 }
78         }
79         container amId {
80                 leaf am-tag {
81                         type uint16;
82                         description "Application Manager Tag -- unique for this operator";
83                 }
84                 leaf am-type {
85                         type uint16;
86                         description "Application Manager Type -- unique for this AM tag";
87                 }
88         }
89                 leaf-list subscriber-subnets {
90                         type inet:ip-prefix;
91                 }
92                 leaf-list upstream-scns {
93                         type service-class-name;
94                 }
95                 leaf-list downstream-scns {
96                         type service-class-name;
97                 }
98         }
99
100         // PCMM QoS Gates
101     container qos {
102         description "
103                 PCMM QoS Gates are organized as a tree by Application/Subscriber/Gate:
104                         Each Application is known by its appId which is any string.
105                         Each Subscriber is known by its subId which is a CPE IP address in either IPv4 or IPv6 format.
106                         Each Gate is known by its gateId which is any string.
107
108                 The subscriber's CPE IP address is used to locate the CCAP device that is currently hosting the
109                 the Cable Modem that is connected to the subscriber's device. Therefore, it is not necessary
110                 for the PCMM applications to know the topology of the CCAP devices and CMs in the network path
111                 to their subscriber devices.
112
113                 Note that each CCAP entry contains a list of connected subscriber IP subnets as well as a list
114                 of all Service Class Names (SCNs) available on the CCAP device.
115                 ";
116                 uses pcmm-qos-gates;
117     }
118
119     grouping pcmm-qos-gates {
120         list apps {
121             key "appId";
122                     leaf appId {
123                         type string;
124                         description "Application Identity";
125                     }
126             list subs {
127                 key "subId";
128                             leaf subId {
129                             type string;
130                                 description "Subscriber Identity -- must be a CM or CPE IP address";
131                             }
132                     list gates {
133                         key "gateId";
134                                     leaf gateId {
135                                         type string;
136                                         description "Qos Gate Identity";
137                                     }
138                                     uses pcmm-qos-gate-attributes;
139                     }
140             }
141         }
142     }
143
144     grouping pcmm-qos-gate-attributes {
145         uses pcmm-qos-gate-spec;
146         uses pcmm-qos-traffic-profile;
147                 uses pcmm-qos-classifier;
148                 uses pcmm-qos-ext-classifier;
149                 uses pcmm-qos-ipv6-classifier;
150     }
151
152     grouping pcmm-qos-gate-spec {
153         container gate-spec {
154                         leaf direction {
155                                 type service-flow-direction;
156                                 description "Gate Direction (ignored for traffic profile SCN)";
157                         }
158                         leaf dscp-tos-overwrite {
159                                 type tos-byte;
160                                 description "Optional DSCP/TOS overwrite value";
161                         }
162                         leaf dscp-tos-mask {
163                                 type tos-byte;
164                                 description "Optional DSCP/TOS overwrite AND mask";
165                         }
166                 }
167     }
168
169     grouping pcmm-qos-traffic-profile {
170         container traffic-profile {
171                     leaf service-class-name {
172                         type service-class-name;
173                         description "The Service Class Name (SCN). This SCN must be pre-provisioned on the target CCAP";
174                     }
175                 }
176     }
177
178     grouping tp-port-match-ranges {
179         leaf srcPort-start {
180             type inet:port-number;
181             description "TCP/UDP source port range start.";
182         }
183         leaf srcPort-end {
184             type inet:port-number;
185             description "TCP/UDP source port range end.";
186         }
187         leaf dstPort-start {
188             type inet:port-number;
189             description "TCP/UDP destination port range start.";
190         }
191         leaf dstPort-end {
192             type inet:port-number;
193             description "TCP/UDP destination port range end.";
194         }
195     }
196
197     grouping pcmm-qos-classifier {
198         container classifier {
199                 leaf srcIp {
200                         type inet:ipv4-address;
201                         description "Source IPv4 address (exact match)";
202                         }
203                 leaf dstIp {
204                         type inet:ipv4-address;
205                         description "Destination IPv4 address (exact match)";
206                         }
207                         leaf tos-byte {
208                                 type tos-byte;
209                                 description "TOS/DSCP match";
210                         }
211                         leaf tos-mask {
212                                 type tos-byte;
213                                 description "TOS/DSCP mask";
214                         }
215                 leaf protocol {
216                         type tp-protocol;
217                         description "IPv4 transport protocol";
218                         }
219                         leaf srcPort {
220                         type inet:port-number;
221                         description "TCP/UDP source port (exact match).";
222                         }
223                         leaf dstPort {
224                         type inet:port-number;
225                         description "TCP/UDP destination port (exact match).";
226                         }
227                 }
228     }
229
230     grouping pcmm-qos-ext-classifier {
231         container ext-classifier {
232                 leaf srcIp {
233                         type inet:ipv4-address;
234                         description "Source IPv4 address match";
235                         }
236                 leaf srcIpMask {
237                         type inet:ipv4-address;
238                         description "Source IPv4 mask";
239                         }
240                 leaf dstIp {
241                         type inet:ipv4-address;
242                         description "Destination IPv4 address match";
243                         }
244                 leaf dstIpMask {
245                         type inet:ipv4-address;
246                         description "Destination IPv4 mask";
247                         }
248                         leaf tos-byte {
249                                 type tos-byte;
250                                 description "TOS/DSCP match";
251                         }
252                         leaf tos-mask {
253                                 type tos-byte;
254                                 description "TOS/DSCP mask";
255                         }
256                 leaf protocol {
257                         type tp-protocol;
258                         description "IPv4 transport protocol";
259                         }
260                         uses tp-port-match-ranges;
261                 }
262     }
263
264     grouping pcmm-qos-ipv6-classifier {
265         container ipv6-classifier {
266                 leaf srcIp6 {
267                         type inet:ipv6-prefix;
268                         description "Source IPv6 prefix match in  <address/len> notation";
269                         }
270                 leaf dstIp6 {
271                         type inet:ipv6-prefix;
272                         description "Destination IPv6 prefix match in <address/len> notation";
273                         }
274                         leaf tc-low {
275                                 type tos-byte;
276                                 description "TC low range match";
277                         }
278                         leaf tc-high {
279                                 type tos-byte;
280                                 description "TC high range match";
281                         }
282                         leaf tc-mask {
283                                 type tos-byte;
284                                 description "TC mask";
285                         }
286                 leaf next-hdr {
287                         type tp-protocol;
288                         description "IPv6 Next Header";
289                         }
290                         leaf flow-label {
291                                 type uint32 {
292                                         range "0 .. 1048575";
293                                 }
294                                 description "IPv6 Flow Label (20 bits)";
295                         }
296                         uses tp-port-match-ranges;
297                 }
298     }
299
300 }
301