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