]>
Commit | Line | Data |
---|---|---|
8c0aa613 | 1 | # -*- Mode: Python -*- |
f7160f32 | 2 | # vim: filetype=python |
8c0aa613 | 3 | |
d3a48372 MAL |
4 | ## |
5 | # = Rocker switch device | |
6 | ## | |
7 | ||
fafa4d50 | 8 | ## |
4d5c8bc4 | 9 | # @RockerSwitch: |
fafa4d50 SF |
10 | # |
11 | # Rocker switch information. | |
12 | # | |
13 | # @name: switch name | |
14 | # | |
15 | # @id: switch ID | |
16 | # | |
17 | # @ports: number of front-panel ports | |
18 | # | |
19 | # Since: 2.4 | |
20 | ## | |
21 | { 'struct': 'RockerSwitch', | |
22 | 'data': { 'name': 'str', 'id': 'uint64', 'ports': 'uint32' } } | |
23 | ||
24 | ## | |
25 | # @query-rocker: | |
26 | # | |
27 | # Return rocker switch information. | |
28 | # | |
29 | # Returns: @Rocker information | |
30 | # | |
31 | # Since: 2.4 | |
a35c33f0 MAL |
32 | # |
33 | # Example: | |
34 | # | |
35 | # -> { "execute": "query-rocker", "arguments": { "name": "sw1" } } | |
36 | # <- { "return": {"name": "sw1", "ports": 2, "id": 1327446905938}} | |
37 | # | |
fafa4d50 SF |
38 | ## |
39 | { 'command': 'query-rocker', | |
40 | 'data': { 'name': 'str' }, | |
41 | 'returns': 'RockerSwitch' } | |
42 | ||
43 | ## | |
44 | # @RockerPortDuplex: | |
45 | # | |
46 | # An eumeration of port duplex states. | |
47 | # | |
48 | # @half: half duplex | |
49 | # | |
50 | # @full: full duplex | |
51 | # | |
52 | # Since: 2.4 | |
53 | ## | |
54 | { 'enum': 'RockerPortDuplex', 'data': [ 'half', 'full' ] } | |
55 | ||
56 | ## | |
57 | # @RockerPortAutoneg: | |
58 | # | |
59 | # An eumeration of port autoneg states. | |
60 | # | |
61 | # @off: autoneg is off | |
62 | # | |
63 | # @on: autoneg is on | |
64 | # | |
65 | # Since: 2.4 | |
66 | ## | |
67 | { 'enum': 'RockerPortAutoneg', 'data': [ 'off', 'on' ] } | |
68 | ||
69 | ## | |
70 | # @RockerPort: | |
71 | # | |
72 | # Rocker switch port information. | |
73 | # | |
74 | # @name: port name | |
75 | # | |
76 | # @enabled: port is enabled for I/O | |
77 | # | |
78 | # @link-up: physical link is UP on port | |
79 | # | |
80 | # @speed: port link speed in Mbps | |
81 | # | |
82 | # @duplex: port link duplex | |
83 | # | |
84 | # @autoneg: port link autoneg | |
85 | # | |
86 | # Since: 2.4 | |
87 | ## | |
88 | { 'struct': 'RockerPort', | |
89 | 'data': { 'name': 'str', 'enabled': 'bool', 'link-up': 'bool', | |
90 | 'speed': 'uint32', 'duplex': 'RockerPortDuplex', | |
91 | 'autoneg': 'RockerPortAutoneg' } } | |
92 | ||
93 | ## | |
94 | # @query-rocker-ports: | |
95 | # | |
7e20b169 | 96 | # Return rocker switch port information. |
fafa4d50 | 97 | # |
7e20b169 | 98 | # Returns: a list of @RockerPort information |
fafa4d50 SF |
99 | # |
100 | # Since: 2.4 | |
7e20b169 MAL |
101 | # |
102 | # Example: | |
103 | # | |
104 | # -> { "execute": "query-rocker-ports", "arguments": { "name": "sw1" } } | |
105 | # <- { "return": [ {"duplex": "full", "enabled": true, "name": "sw1.1", | |
106 | # "autoneg": "off", "link-up": true, "speed": 10000}, | |
107 | # {"duplex": "full", "enabled": true, "name": "sw1.2", | |
108 | # "autoneg": "off", "link-up": true, "speed": 10000} | |
109 | # ]} | |
110 | # | |
fafa4d50 SF |
111 | ## |
112 | { 'command': 'query-rocker-ports', | |
113 | 'data': { 'name': 'str' }, | |
114 | 'returns': ['RockerPort'] } | |
115 | ||
116 | ## | |
117 | # @RockerOfDpaFlowKey: | |
118 | # | |
119 | # Rocker switch OF-DPA flow key | |
120 | # | |
121 | # @priority: key priority, 0 being lowest priority | |
122 | # | |
123 | # @tbl-id: flow table ID | |
124 | # | |
1d8bda12 | 125 | # @in-pport: physical input port |
fafa4d50 | 126 | # |
1d8bda12 | 127 | # @tunnel-id: tunnel ID |
fafa4d50 | 128 | # |
1d8bda12 | 129 | # @vlan-id: VLAN ID |
fafa4d50 | 130 | # |
1d8bda12 | 131 | # @eth-type: Ethernet header type |
fafa4d50 | 132 | # |
1d8bda12 | 133 | # @eth-src: Ethernet header source MAC address |
fafa4d50 | 134 | # |
1d8bda12 | 135 | # @eth-dst: Ethernet header destination MAC address |
fafa4d50 | 136 | # |
1d8bda12 | 137 | # @ip-proto: IP Header protocol field |
fafa4d50 | 138 | # |
1d8bda12 | 139 | # @ip-tos: IP header TOS field |
fafa4d50 | 140 | # |
1d8bda12 | 141 | # @ip-dst: IP header destination address |
fafa4d50 | 142 | # |
8c0aa613 | 143 | # Note: optional members may or may not appear in the flow key |
26ec4e53 | 144 | # depending if they're relevant to the flow key. |
fafa4d50 SF |
145 | # |
146 | # Since: 2.4 | |
147 | ## | |
148 | { 'struct': 'RockerOfDpaFlowKey', | |
149 | 'data' : { 'priority': 'uint32', 'tbl-id': 'uint32', '*in-pport': 'uint32', | |
150 | '*tunnel-id': 'uint32', '*vlan-id': 'uint16', | |
151 | '*eth-type': 'uint16', '*eth-src': 'str', '*eth-dst': 'str', | |
152 | '*ip-proto': 'uint8', '*ip-tos': 'uint8', '*ip-dst': 'str' } } | |
153 | ||
154 | ## | |
155 | # @RockerOfDpaFlowMask: | |
156 | # | |
157 | # Rocker switch OF-DPA flow mask | |
158 | # | |
1d8bda12 | 159 | # @in-pport: physical input port |
fafa4d50 | 160 | # |
1d8bda12 | 161 | # @tunnel-id: tunnel ID |
fafa4d50 | 162 | # |
1d8bda12 | 163 | # @vlan-id: VLAN ID |
fafa4d50 | 164 | # |
1d8bda12 | 165 | # @eth-src: Ethernet header source MAC address |
fafa4d50 | 166 | # |
1d8bda12 | 167 | # @eth-dst: Ethernet header destination MAC address |
fafa4d50 | 168 | # |
1d8bda12 | 169 | # @ip-proto: IP Header protocol field |
fafa4d50 | 170 | # |
1d8bda12 | 171 | # @ip-tos: IP header TOS field |
fafa4d50 | 172 | # |
8c0aa613 | 173 | # Note: optional members may or may not appear in the flow mask |
26ec4e53 | 174 | # depending if they're relevant to the flow mask. |
fafa4d50 SF |
175 | # |
176 | # Since: 2.4 | |
177 | ## | |
178 | { 'struct': 'RockerOfDpaFlowMask', | |
179 | 'data' : { '*in-pport': 'uint32', '*tunnel-id': 'uint32', | |
180 | '*vlan-id': 'uint16', '*eth-src': 'str', '*eth-dst': 'str', | |
181 | '*ip-proto': 'uint8', '*ip-tos': 'uint8' } } | |
182 | ||
183 | ## | |
184 | # @RockerOfDpaFlowAction: | |
185 | # | |
186 | # Rocker switch OF-DPA flow action | |
187 | # | |
1d8bda12 | 188 | # @goto-tbl: next table ID |
fafa4d50 | 189 | # |
1d8bda12 | 190 | # @group-id: group ID |
fafa4d50 | 191 | # |
1d8bda12 | 192 | # @tunnel-lport: tunnel logical port ID |
fafa4d50 | 193 | # |
1d8bda12 | 194 | # @vlan-id: VLAN ID |
fafa4d50 | 195 | # |
1d8bda12 | 196 | # @new-vlan-id: new VLAN ID |
fafa4d50 | 197 | # |
1d8bda12 | 198 | # @out-pport: physical output port |
fafa4d50 | 199 | # |
8c0aa613 | 200 | # Note: optional members may or may not appear in the flow action |
26ec4e53 | 201 | # depending if they're relevant to the flow action. |
fafa4d50 SF |
202 | # |
203 | # Since: 2.4 | |
204 | ## | |
205 | { 'struct': 'RockerOfDpaFlowAction', | |
206 | 'data' : { '*goto-tbl': 'uint32', '*group-id': 'uint32', | |
207 | '*tunnel-lport': 'uint32', '*vlan-id': 'uint16', | |
208 | '*new-vlan-id': 'uint16', '*out-pport': 'uint32' } } | |
209 | ||
210 | ## | |
211 | # @RockerOfDpaFlow: | |
212 | # | |
213 | # Rocker switch OF-DPA flow | |
214 | # | |
215 | # @cookie: flow unique cookie ID | |
216 | # | |
217 | # @hits: count of matches (hits) on flow | |
218 | # | |
219 | # @key: flow key | |
220 | # | |
221 | # @mask: flow mask | |
222 | # | |
223 | # @action: flow action | |
224 | # | |
225 | # Since: 2.4 | |
226 | ## | |
227 | { 'struct': 'RockerOfDpaFlow', | |
228 | 'data': { 'cookie': 'uint64', 'hits': 'uint64', 'key': 'RockerOfDpaFlowKey', | |
229 | 'mask': 'RockerOfDpaFlowMask', 'action': 'RockerOfDpaFlowAction' } } | |
230 | ||
231 | ## | |
232 | # @query-rocker-of-dpa-flows: | |
233 | # | |
234 | # Return rocker OF-DPA flow information. | |
235 | # | |
236 | # @name: switch name | |
237 | # | |
1d8bda12 | 238 | # @tbl-id: flow table ID. If tbl-id is not specified, returns |
26ec4e53 | 239 | # flow information for all tables. |
fafa4d50 | 240 | # |
435fcb29 | 241 | # Returns: rocker OF-DPA flow information |
fafa4d50 SF |
242 | # |
243 | # Since: 2.4 | |
435fcb29 MAL |
244 | # |
245 | # Example: | |
246 | # | |
247 | # -> { "execute": "query-rocker-of-dpa-flows", | |
248 | # "arguments": { "name": "sw1" } } | |
249 | # <- { "return": [ {"key": {"in-pport": 0, "priority": 1, "tbl-id": 0}, | |
250 | # "hits": 138, | |
251 | # "cookie": 0, | |
252 | # "action": {"goto-tbl": 10}, | |
253 | # "mask": {"in-pport": 4294901760} | |
254 | # }, | |
255 | # {...more...}, | |
256 | # ]} | |
257 | # | |
fafa4d50 SF |
258 | ## |
259 | { 'command': 'query-rocker-of-dpa-flows', | |
260 | 'data': { 'name': 'str', '*tbl-id': 'uint32' }, | |
261 | 'returns': ['RockerOfDpaFlow'] } | |
262 | ||
263 | ## | |
264 | # @RockerOfDpaGroup: | |
265 | # | |
266 | # Rocker switch OF-DPA group | |
267 | # | |
268 | # @id: group unique ID | |
269 | # | |
270 | # @type: group type | |
271 | # | |
1d8bda12 | 272 | # @vlan-id: VLAN ID |
fafa4d50 | 273 | # |
1d8bda12 | 274 | # @pport: physical port number |
fafa4d50 | 275 | # |
1d8bda12 | 276 | # @index: group index, unique with group type |
fafa4d50 | 277 | # |
1d8bda12 | 278 | # @out-pport: output physical port number |
fafa4d50 | 279 | # |
1d8bda12 | 280 | # @group-id: next group ID |
fafa4d50 | 281 | # |
1d8bda12 | 282 | # @set-vlan-id: VLAN ID to set |
fafa4d50 | 283 | # |
1d8bda12 | 284 | # @pop-vlan: pop VLAN headr from packet |
fafa4d50 | 285 | # |
1d8bda12 | 286 | # @group-ids: list of next group IDs |
fafa4d50 | 287 | # |
1d8bda12 | 288 | # @set-eth-src: set source MAC address in Ethernet header |
fafa4d50 | 289 | # |
1d8bda12 | 290 | # @set-eth-dst: set destination MAC address in Ethernet header |
fafa4d50 | 291 | # |
1d8bda12 | 292 | # @ttl-check: perform TTL check |
fafa4d50 | 293 | # |
8c0aa613 | 294 | # Note: optional members may or may not appear in the group depending |
26ec4e53 | 295 | # if they're relevant to the group type. |
fafa4d50 SF |
296 | # |
297 | # Since: 2.4 | |
298 | ## | |
299 | { 'struct': 'RockerOfDpaGroup', | |
300 | 'data': { 'id': 'uint32', 'type': 'uint8', '*vlan-id': 'uint16', | |
301 | '*pport': 'uint32', '*index': 'uint32', '*out-pport': 'uint32', | |
302 | '*group-id': 'uint32', '*set-vlan-id': 'uint16', | |
303 | '*pop-vlan': 'uint8', '*group-ids': ['uint32'], | |
304 | '*set-eth-src': 'str', '*set-eth-dst': 'str', | |
305 | '*ttl-check': 'uint8' } } | |
306 | ||
307 | ## | |
308 | # @query-rocker-of-dpa-groups: | |
309 | # | |
310 | # Return rocker OF-DPA group information. | |
311 | # | |
312 | # @name: switch name | |
313 | # | |
1d8bda12 | 314 | # @type: group type. If type is not specified, returns |
26ec4e53 | 315 | # group information for all group types. |
fafa4d50 | 316 | # |
9389a4e3 | 317 | # Returns: rocker OF-DPA group information |
fafa4d50 SF |
318 | # |
319 | # Since: 2.4 | |
9389a4e3 MAL |
320 | # |
321 | # Example: | |
322 | # | |
323 | # -> { "execute": "query-rocker-of-dpa-groups", | |
324 | # "arguments": { "name": "sw1" } } | |
325 | # <- { "return": [ {"type": 0, "out-pport": 2, | |
326 | # "pport": 2, "vlan-id": 3841, | |
327 | # "pop-vlan": 1, "id": 251723778}, | |
328 | # {"type": 0, "out-pport": 0, | |
329 | # "pport": 0, "vlan-id": 3841, | |
330 | # "pop-vlan": 1, "id": 251723776}, | |
331 | # {"type": 0, "out-pport": 1, | |
332 | # "pport": 1, "vlan-id": 3840, | |
333 | # "pop-vlan": 1, "id": 251658241}, | |
334 | # {"type": 0, "out-pport": 0, | |
335 | # "pport": 0, "vlan-id": 3840, | |
336 | # "pop-vlan": 1, "id": 251658240} | |
337 | # ]} | |
338 | # | |
fafa4d50 SF |
339 | ## |
340 | { 'command': 'query-rocker-of-dpa-groups', | |
341 | 'data': { 'name': 'str', '*type': 'uint8' }, | |
342 | 'returns': ['RockerOfDpaGroup'] } |