blob: b48e49a89bb3a4741621281b938dd121cc9ce7d0 [file] [log] [blame]
Markus Armbruster8c0aa612017-03-15 13:57:01 +01001# -*- Mode: Python -*-
Andrea Bolognanif7160f32020-07-29 20:50:24 +02002# vim: filetype=python
Markus Armbruster8c0aa612017-03-15 13:57:01 +01003
Scott Feldmanfafa4d52015-06-10 18:21:21 -07004##
Marc-André Lureaud3a48372017-01-13 15:41:23 +01005# = Rocker switch device
6##
7
8##
Marc-André Lureau4d5c8bc2016-11-17 19:54:53 +04009# @RockerSwitch:
Scott Feldmanfafa4d52015-06-10 18:21:21 -070010#
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
Marc-André Lureaua35c33f2016-06-23 15:11:47 +020032#
33# Example:
34#
35# -> { "execute": "query-rocker", "arguments": { "name": "sw1" } }
36# <- { "return": {"name": "sw1", "ports": 2, "id": 1327446905938}}
37#
Scott Feldmanfafa4d52015-06-10 18:21:21 -070038##
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#
Marc-André Lureau7e20b162016-06-23 15:12:36 +020096# Return rocker switch port information.
Scott Feldmanfafa4d52015-06-10 18:21:21 -070097#
Marc-André Lureau7e20b162016-06-23 15:12:36 +020098# Returns: a list of @RockerPort information
Scott Feldmanfafa4d52015-06-10 18:21:21 -070099#
100# Since: 2.4
Marc-André Lureau7e20b162016-06-23 15:12:36 +0200101#
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#
Scott Feldmanfafa4d52015-06-10 18:21:21 -0700111##
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#
Markus Armbruster1d8bda12017-03-15 13:57:06 +0100125# @in-pport: physical input port
Scott Feldmanfafa4d52015-06-10 18:21:21 -0700126#
Markus Armbruster1d8bda12017-03-15 13:57:06 +0100127# @tunnel-id: tunnel ID
Scott Feldmanfafa4d52015-06-10 18:21:21 -0700128#
Markus Armbruster1d8bda12017-03-15 13:57:06 +0100129# @vlan-id: VLAN ID
Scott Feldmanfafa4d52015-06-10 18:21:21 -0700130#
Markus Armbruster1d8bda12017-03-15 13:57:06 +0100131# @eth-type: Ethernet header type
Scott Feldmanfafa4d52015-06-10 18:21:21 -0700132#
Markus Armbruster1d8bda12017-03-15 13:57:06 +0100133# @eth-src: Ethernet header source MAC address
Scott Feldmanfafa4d52015-06-10 18:21:21 -0700134#
Markus Armbruster1d8bda12017-03-15 13:57:06 +0100135# @eth-dst: Ethernet header destination MAC address
Scott Feldmanfafa4d52015-06-10 18:21:21 -0700136#
Markus Armbruster1d8bda12017-03-15 13:57:06 +0100137# @ip-proto: IP Header protocol field
Scott Feldmanfafa4d52015-06-10 18:21:21 -0700138#
Markus Armbruster1d8bda12017-03-15 13:57:06 +0100139# @ip-tos: IP header TOS field
Scott Feldmanfafa4d52015-06-10 18:21:21 -0700140#
Markus Armbruster1d8bda12017-03-15 13:57:06 +0100141# @ip-dst: IP header destination address
Scott Feldmanfafa4d52015-06-10 18:21:21 -0700142#
Markus Armbruster8c0aa612017-03-15 13:57:01 +0100143# Note: optional members may or may not appear in the flow key
Peter Maydell26ec4e52020-02-13 17:56:26 +0000144# depending if they're relevant to the flow key.
Scott Feldmanfafa4d52015-06-10 18:21:21 -0700145#
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#
Markus Armbruster1d8bda12017-03-15 13:57:06 +0100159# @in-pport: physical input port
Scott Feldmanfafa4d52015-06-10 18:21:21 -0700160#
Markus Armbruster1d8bda12017-03-15 13:57:06 +0100161# @tunnel-id: tunnel ID
Scott Feldmanfafa4d52015-06-10 18:21:21 -0700162#
Markus Armbruster1d8bda12017-03-15 13:57:06 +0100163# @vlan-id: VLAN ID
Scott Feldmanfafa4d52015-06-10 18:21:21 -0700164#
Markus Armbruster1d8bda12017-03-15 13:57:06 +0100165# @eth-src: Ethernet header source MAC address
Scott Feldmanfafa4d52015-06-10 18:21:21 -0700166#
Markus Armbruster1d8bda12017-03-15 13:57:06 +0100167# @eth-dst: Ethernet header destination MAC address
Scott Feldmanfafa4d52015-06-10 18:21:21 -0700168#
Markus Armbruster1d8bda12017-03-15 13:57:06 +0100169# @ip-proto: IP Header protocol field
Scott Feldmanfafa4d52015-06-10 18:21:21 -0700170#
Markus Armbruster1d8bda12017-03-15 13:57:06 +0100171# @ip-tos: IP header TOS field
Scott Feldmanfafa4d52015-06-10 18:21:21 -0700172#
Markus Armbruster8c0aa612017-03-15 13:57:01 +0100173# Note: optional members may or may not appear in the flow mask
Peter Maydell26ec4e52020-02-13 17:56:26 +0000174# depending if they're relevant to the flow mask.
Scott Feldmanfafa4d52015-06-10 18:21:21 -0700175#
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#
Markus Armbruster1d8bda12017-03-15 13:57:06 +0100188# @goto-tbl: next table ID
Scott Feldmanfafa4d52015-06-10 18:21:21 -0700189#
Markus Armbruster1d8bda12017-03-15 13:57:06 +0100190# @group-id: group ID
Scott Feldmanfafa4d52015-06-10 18:21:21 -0700191#
Markus Armbruster1d8bda12017-03-15 13:57:06 +0100192# @tunnel-lport: tunnel logical port ID
Scott Feldmanfafa4d52015-06-10 18:21:21 -0700193#
Markus Armbruster1d8bda12017-03-15 13:57:06 +0100194# @vlan-id: VLAN ID
Scott Feldmanfafa4d52015-06-10 18:21:21 -0700195#
Markus Armbruster1d8bda12017-03-15 13:57:06 +0100196# @new-vlan-id: new VLAN ID
Scott Feldmanfafa4d52015-06-10 18:21:21 -0700197#
Markus Armbruster1d8bda12017-03-15 13:57:06 +0100198# @out-pport: physical output port
Scott Feldmanfafa4d52015-06-10 18:21:21 -0700199#
Markus Armbruster8c0aa612017-03-15 13:57:01 +0100200# Note: optional members may or may not appear in the flow action
Peter Maydell26ec4e52020-02-13 17:56:26 +0000201# depending if they're relevant to the flow action.
Scott Feldmanfafa4d52015-06-10 18:21:21 -0700202#
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#
Markus Armbruster1d8bda12017-03-15 13:57:06 +0100238# @tbl-id: flow table ID. If tbl-id is not specified, returns
Peter Maydell26ec4e52020-02-13 17:56:26 +0000239# flow information for all tables.
Scott Feldmanfafa4d52015-06-10 18:21:21 -0700240#
Marc-André Lureau435fcb22016-06-23 15:14:30 +0200241# Returns: rocker OF-DPA flow information
Scott Feldmanfafa4d52015-06-10 18:21:21 -0700242#
243# Since: 2.4
Marc-André Lureau435fcb22016-06-23 15:14:30 +0200244#
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#
Scott Feldmanfafa4d52015-06-10 18:21:21 -0700258##
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#
Markus Armbruster1d8bda12017-03-15 13:57:06 +0100272# @vlan-id: VLAN ID
Scott Feldmanfafa4d52015-06-10 18:21:21 -0700273#
Markus Armbruster1d8bda12017-03-15 13:57:06 +0100274# @pport: physical port number
Scott Feldmanfafa4d52015-06-10 18:21:21 -0700275#
Markus Armbruster1d8bda12017-03-15 13:57:06 +0100276# @index: group index, unique with group type
Scott Feldmanfafa4d52015-06-10 18:21:21 -0700277#
Markus Armbruster1d8bda12017-03-15 13:57:06 +0100278# @out-pport: output physical port number
Scott Feldmanfafa4d52015-06-10 18:21:21 -0700279#
Markus Armbruster1d8bda12017-03-15 13:57:06 +0100280# @group-id: next group ID
Scott Feldmanfafa4d52015-06-10 18:21:21 -0700281#
Markus Armbruster1d8bda12017-03-15 13:57:06 +0100282# @set-vlan-id: VLAN ID to set
Scott Feldmanfafa4d52015-06-10 18:21:21 -0700283#
Markus Armbruster1d8bda12017-03-15 13:57:06 +0100284# @pop-vlan: pop VLAN headr from packet
Scott Feldmanfafa4d52015-06-10 18:21:21 -0700285#
Markus Armbruster1d8bda12017-03-15 13:57:06 +0100286# @group-ids: list of next group IDs
Scott Feldmanfafa4d52015-06-10 18:21:21 -0700287#
Markus Armbruster1d8bda12017-03-15 13:57:06 +0100288# @set-eth-src: set source MAC address in Ethernet header
Scott Feldmanfafa4d52015-06-10 18:21:21 -0700289#
Markus Armbruster1d8bda12017-03-15 13:57:06 +0100290# @set-eth-dst: set destination MAC address in Ethernet header
Scott Feldmanfafa4d52015-06-10 18:21:21 -0700291#
Markus Armbruster1d8bda12017-03-15 13:57:06 +0100292# @ttl-check: perform TTL check
Scott Feldmanfafa4d52015-06-10 18:21:21 -0700293#
Markus Armbruster8c0aa612017-03-15 13:57:01 +0100294# Note: optional members may or may not appear in the group depending
Peter Maydell26ec4e52020-02-13 17:56:26 +0000295# if they're relevant to the group type.
Scott Feldmanfafa4d52015-06-10 18:21:21 -0700296#
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#
Markus Armbruster1d8bda12017-03-15 13:57:06 +0100314# @type: group type. If type is not specified, returns
Peter Maydell26ec4e52020-02-13 17:56:26 +0000315# group information for all group types.
Scott Feldmanfafa4d52015-06-10 18:21:21 -0700316#
Marc-André Lureau9389a4e2016-06-23 15:17:32 +0200317# Returns: rocker OF-DPA group information
Scott Feldmanfafa4d52015-06-10 18:21:21 -0700318#
319# Since: 2.4
Marc-André Lureau9389a4e2016-06-23 15:17:32 +0200320#
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#
Scott Feldmanfafa4d52015-06-10 18:21:21 -0700339##
340{ 'command': 'query-rocker-of-dpa-groups',
341 'data': { 'name': 'str', '*type': 'uint8' },
342 'returns': ['RockerOfDpaGroup'] }