backing up
[vsorcdistro/.git] / ryu / build / lib.linux-armv7l-2.7 / ryu / lib / of_config / generated_classes.py
1 # Copyright (C) 2013 Nippon Telegraph and Telephone Corporation.
2 # Copyright (C) 2013 YAMAMOTO Takashi <yamamoto at valinux co 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 # NOTE: this file is intendend to be replaced with mechanically generated
18 # file if/when OF-Config yang specification is available with a suitable
19 # license.
20
21 from ryu.lib.of_config.base import _Base, _e, _ct
22
23
24 class OFPortConfigurationType(_Base):
25     _ELEMENTS = [
26         _e('admin-state', is_list=False),
27         _e('no-receive', is_list=False),
28         _e('no-forward', is_list=False),
29         _e('no-packet-in', is_list=False),
30     ]
31
32
33 class OFPortStateType(_Base):
34     _ELEMENTS = [
35         _e('oper-state', is_list=False),
36         _e('blocked', is_list=False),
37         _e('live', is_list=False),
38     ]
39
40
41 class OFPortType(_Base):
42     _ELEMENTS = [
43         _e('resource-id', is_list=False),
44         _e('number', is_list=False),
45         _e('name', is_list=False),
46         _e('current-rate', is_list=False),
47         _e('max-rate', is_list=False),
48         _ct('configuration', OFPortConfigurationType, is_list=False),
49         _ct('state', OFPortStateType, is_list=False),
50         _ct('features', None, is_list=False),
51         _ct('tunnel-type', None, is_list=False),
52     ]
53
54
55 class OFQueuePropertiesType(_Base):
56     _ELEMENTS = [
57         _e('min-rate', is_list=False),
58         _e('max-rate', is_list=False),
59         _e('experimenter', is_list=True),
60     ]
61
62
63 class OFQueueType(_Base):
64     _ELEMENTS = [
65         _e('resource-id', is_list=False),
66         _e('id', is_list=False),
67         _e('port', is_list=False),
68         _ct('properties', OFQueuePropertiesType, is_list=False),
69     ]
70
71
72 class OFCapableSwitchResourcesType(_Base):
73     _ELEMENTS = [
74         _ct('port', OFPortType, is_list=True),
75         _ct('queue', OFQueueType, is_list=True),
76         _ct('owned-certificate', None, is_list=True),
77         _ct('external-certificate', None, is_list=True),
78         _ct('flow-table', None, is_list=True),
79     ]
80
81
82 class OFControllerStateType(_Base):
83     _ELEMENTS = [
84         _e('connection-state', is_list=False),
85         _e('current-version', is_list=False),
86
87         # XXX OF-Config 1.1.1 is inconsistent about supported-versions.
88         #
89         # according to its xml schema (p.43), i believe this should look
90         # like the following.  it's what linc/of_config does, too.
91         #     <supported-versions>1.3</supported-versions>
92         #
93         # on the other hand, it has an example (p.45) like the following.
94         # this one is compatible with OF-Config 1.1.
95         #     <supported-versions>
96         #         <version>1.2</version>
97         #         <version>1.1</version>
98         #     </supported-versions>
99
100         _e('supported-versions', is_list=True),
101         _e('local-ip-address-in-use', is_list=False),
102         _e('local-port-in-use', is_list=False),
103     ]
104
105
106 class OFControllerType(_Base):
107     _ELEMENTS = [
108         _e('id', is_list=False),
109         _e('role', is_list=False),
110         _e('ip-address', is_list=False),
111         _e('port', is_list=False),
112         _e('local-ip-address', is_list=False),
113         _e('local-port', is_list=False),
114         _e('protocol', is_list=False),
115         _ct('state', OFControllerStateType, is_list=False),
116     ]
117
118
119 class OFLogicalSwitchControllersType(_Base):
120     _ELEMENTS = [
121         _ct('controller', OFControllerType, is_list=True),
122     ]
123
124
125 class OFLogicalSwitchResourcesType(_Base):
126     _ELEMENTS = [
127         _e('port', is_list=True),
128         _e('queue', is_list=True),
129         _e('certificate', is_list=False),
130         _e('flow-table', is_list=True),
131     ]
132
133
134 class OFLogicalSwitchType(_Base):
135     _ELEMENTS = [
136         _e('id', is_list=False),
137         _ct('capabilities', None, is_list=False),
138         _e('datapath-id', is_list=False),
139         _e('enabled', is_list=False),
140         _e('check-controller-certificate', is_list=False),
141         _e('lost-connection-behavior', is_list=False),
142         _ct('controllers', OFLogicalSwitchControllersType, is_list=False),
143         _ct('resources', OFLogicalSwitchResourcesType, is_list=False),
144     ]
145
146
147 class OFCapableSwitchLogicalSwitchesType(_Base):
148     _ELEMENTS = [
149         # this is named 'logical-switch' for OF-Config 1.1.
150         _ct('switch', OFLogicalSwitchType, is_list=True),
151     ]
152
153
154 class OFCapableSwitchType(_Base):
155     _ELEMENTS = [
156         _e('id', is_list=False),
157         _e('config-version', is_list=False),
158         _ct('configuration-points', None, is_list=False),
159         _ct('resources', OFCapableSwitchResourcesType, is_list=False),
160         _ct('logical-switches', OFCapableSwitchLogicalSwitchesType,
161             is_list=False),
162     ]