backing up
[vsorcdistro/.git] / ryu / build / lib.linux-armv7l-2.7 / ryu / lib / of_config / __init__.py
1 # Copyright (C) 2013 Nippon Telegraph and Telephone Corporation.
2 # Copyright (C) 2013 Isaku Yamahata <yamahata at private email ne jp>
3 #
4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at
7 #
8 #    http://www.apache.org/licenses/LICENSE-2.0
9 #
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
13 # implied.
14 # See the License for the specific language governing permissions and
15 # limitations under the License.
16
17 """
18 OF-Config implementation.
19 """
20
21 import glob
22 import os.path
23 import sys
24
25
26 SCHEMA_DIR = os.path.dirname(__file__)
27
28 _PREFIX = 'of-config-'
29 _SUFFIX = '.xsd'
30 _files = glob.glob(os.path.join(SCHEMA_DIR, 'of-config-*.xsd'))
31 OF_CONFIG_XSD_FILES = dict(
32     (os.path.basename(f)[len(_PREFIX):-len(_SUFFIX)], f) for f in _files)
33
34 # For convenience
35 # OF_CONFIG_1_0_XSD = os.path.join(SCHEMA_DIR, 'of-config-1.0.xsd')
36 # and so on
37 _this_module = sys.modules[__name__]
38 for (version, xsd_file) in OF_CONFIG_XSD_FILES.items():
39     setattr(_this_module,
40             'OF_CONFIG_%s_XSD' % version.replace('.', '_'), xsd_file)
41
42
43 OFCONFIG_1_1_CONFIG = 'urn:onf:params:xml:ns:onf:of12:config'
44 OFCONFIG_1_1_YANG = 'urn:onf:of12:config:yang'
45
46 # LINC specific?
47 OFCONFIG_1_1_1_YANG = 'urn:onf:of111:config:yang'
48
49 OFCONFIG_YANG_NAMESPACES = {
50     '1.1': OFCONFIG_1_1_YANG,
51     '1.1.1': OFCONFIG_1_1_1_YANG,
52 }