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