Bug 2231 - Secure transport for PCEP
[bgpcep.git] / pcep / impl / src / main / yang / odl-pcep-impl-cfg.yang
1 // vi: set smarttab et sw=4 tabstop=4:
2 module odl-pcep-impl-cfg {
3     yang-version 1;
4     namespace "urn:opendaylight:params:xml:ns:yang:controller:pcep:impl";
5     prefix "pcep-impl";
6
7     import config { prefix config; revision-date 2013-04-05; }
8     import odl-pcep-api-cfg { prefix pcep; revision-date 2013-04-09; }
9     import odl-pcep-spi-cfg { prefix spi; revision-date 2013-11-15; }
10     import netty { prefix netty; revision-date 2013-11-19; }
11     import odl-tcpmd5-netty-cfg { prefix tcpmd5; revision-date 2014-04-27; }
12
13     organization "Cisco Systems, Inc.";
14
15     contact "Robert Varga <rovarga@cisco.com>";
16
17     description
18         "This module contains the base YANG definitions for
19          PCEP implementation.
20
21         Copyright (c)2013 Cisco Systems, Inc. All rights reserved.;
22
23         This program and the accompanying materials are made available
24         under the terms of the Eclipse Public License v1.0 which
25         accompanies this distribution, and is available at
26         http://www.eclipse.org/legal/epl-v10.html";
27
28     revision "2013-06-27" {
29         description
30             "Updated revision dates for imports.";
31     }
32
33     revision "2013-04-09" {
34         description
35             "Initial revision";
36     }
37
38     typedef path-type {
39         type enumeration {
40             enum "PATH";
41             enum "CLASSPATH";
42         }
43     }
44
45     typedef store-type {
46         type enumeration {
47             enum "JKS";
48             enum "PKCS12";
49         }
50     }
51
52     identity pcep-parser-base {
53         base config:module-type;
54         config:provided-service spi:extension;
55         config:java-name-prefix BasePCEPParser;
56     }
57
58     augment "/config:modules/config:module/config:configuration" {
59         case pcep-parser-base {
60             when "/config:modules/config:module/config:type = 'pcep-parser-base'";
61         }
62     }
63
64     identity pcep-dispatcher-impl {
65         base config:module-type;
66         config:provided-service pcep:pcep-dispatcher;
67         config:java-name-prefix PCEPDispatcherImpl;
68     }
69
70     augment "/config:modules/config:module/config:configuration" {
71         case pcep-dispatcher-impl {
72             when "/config:modules/config:module/config:type = 'pcep-dispatcher-impl'";
73
74             leaf max-unknown-messages {
75                 type uint16;
76                 default 5;
77             }
78
79             container pcep-extensions {
80                 uses config:service-ref {
81                     refine type {
82                         mandatory true;
83                         config:required-identity spi:consumer-extensions;
84                     }
85                 }
86             }
87
88             container pcep-session-proposal-factory {
89                 uses config:service-ref {
90                     refine type {
91                         mandatory true;
92                         config:required-identity pcep:pcep-session-proposal-factory;
93                     }
94                 }
95             }
96
97             container boss-group {
98                 uses config:service-ref {
99                     refine type {
100                         mandatory true;
101                         config:required-identity netty:netty-threadgroup;
102                     }
103                 }
104             }
105
106             container worker-group {
107                 uses config:service-ref {
108                     refine type {
109                         mandatory true;
110                         config:required-identity netty:netty-threadgroup;
111                     }
112                 }
113             }
114
115             container md5-channel-factory {
116                 uses config:service-ref {
117                     refine type {
118                         mandatory false;
119                         config:required-identity tcpmd5:md5-channel-factory;
120                     }
121                 }
122             }
123
124             container md5-server-channel-factory {
125                 uses config:service-ref {
126                     refine type {
127                         mandatory false;
128                         config:required-identity tcpmd5:md5-server-channel-factory;
129                     }
130                 }
131             }
132
133             container tls {
134                 leaf keystore {
135                     description "keystore location";
136                     type string;
137                     mandatory true;
138                 }
139                 leaf keystore-type {
140                     description "keystore type (JKS or PKCS12)";
141                     type store-type;
142                     mandatory true;
143                 }
144                 leaf keystore-path-type {
145                     description "keystore path type (CLASSPATH or PATH)";
146                     type path-type;
147                     mandatory true;
148                 }
149                 leaf keystore-password {
150                     description "password protecting keystore";
151                     type string;
152                     mandatory true;
153                 }
154                 leaf certificate-password {
155                     description "password protecting certificate";
156                     type string;
157                     mandatory true;
158                 }
159                 leaf truststore {
160                     description "truststore location";
161                     type string;
162                     mandatory true;
163                 }
164                 leaf truststore-type {
165                     description "truststore type (JKS or PKCS12)";
166                     type store-type;
167                     mandatory true;
168                 }
169                 leaf truststore-path-type {
170                     description "truststore path type (CLASSPATH or PATH)";
171                     type path-type;
172                     mandatory true;
173                 }
174                 leaf truststore-password {
175                     description "password protecting truststore";
176                     type string;
177                     mandatory true;
178                 }
179             }
180         }
181     }
182
183     identity pcep-session-proposal-factory-impl {
184         base config:module-type;
185         config:java-name-prefix "PCEPSessionProposalFactoryImpl";
186         config:provided-service pcep:pcep-session-proposal-factory;
187     }
188
189     augment "/config:modules/config:module/config:configuration" {
190         case pcep-session-proposal-factory-impl {
191             when "/config:modules/config:module/config:type = 'pcep-session-proposal-factory-impl'";
192
193             leaf dead-timer-value {
194                 type uint8;
195                 default 120;
196             }
197
198             leaf keep-alive-timer-value {
199                 type uint8;
200                 default 30;
201             }
202         }
203     }
204 }
205