xref: /openbmc/qemu/qapi/rocker.json (revision b91a0fa7)
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# Example:
34#
35# -> { "execute": "query-rocker", "arguments": { "name": "sw1" } }
36# <- { "return": {"name": "sw1", "ports": 2, "id": 1327446905938}}
37#
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#
96# Return rocker switch port information.
97#
98# Returns: a list of @RockerPort information
99#
100# Since: 2.4
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#
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#
125# @in-pport: physical input port
126#
127# @tunnel-id: tunnel ID
128#
129# @vlan-id: VLAN ID
130#
131# @eth-type: Ethernet header type
132#
133# @eth-src: Ethernet header source MAC address
134#
135# @eth-dst: Ethernet header destination MAC address
136#
137# @ip-proto: IP Header protocol field
138#
139# @ip-tos: IP header TOS field
140#
141# @ip-dst: IP header destination address
142#
143# Note: optional members may or may not appear in the flow key
144#       depending if they're relevant to the flow key.
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#
159# @in-pport: physical input port
160#
161# @tunnel-id: tunnel ID
162#
163# @vlan-id: VLAN ID
164#
165# @eth-src: Ethernet header source MAC address
166#
167# @eth-dst: Ethernet header destination MAC address
168#
169# @ip-proto: IP Header protocol field
170#
171# @ip-tos: IP header TOS field
172#
173# Note: optional members may or may not appear in the flow mask
174#       depending if they're relevant to the flow mask.
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#
188# @goto-tbl: next table ID
189#
190# @group-id: group ID
191#
192# @tunnel-lport: tunnel logical port ID
193#
194# @vlan-id: VLAN ID
195#
196# @new-vlan-id: new VLAN ID
197#
198# @out-pport: physical output port
199#
200# Note: optional members may or may not appear in the flow action
201#       depending if they're relevant to the flow action.
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#
238# @tbl-id: flow table ID.  If tbl-id is not specified, returns
239#          flow information for all tables.
240#
241# Returns: rocker OF-DPA flow information
242#
243# Since: 2.4
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#
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#
272# @vlan-id: VLAN ID
273#
274# @pport: physical port number
275#
276# @index: group index, unique with group type
277#
278# @out-pport: output physical port number
279#
280# @group-id: next group ID
281#
282# @set-vlan-id: VLAN ID to set
283#
284# @pop-vlan: pop VLAN headr from packet
285#
286# @group-ids: list of next group IDs
287#
288# @set-eth-src: set source MAC address in Ethernet header
289#
290# @set-eth-dst: set destination MAC address in Ethernet header
291#
292# @ttl-check: perform TTL check
293#
294# Note: optional members may or may not appear in the group depending
295#       if they're relevant to the group type.
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#
314# @type: group type.  If type is not specified, returns
315#        group information for all group types.
316#
317# Returns: rocker OF-DPA group information
318#
319# Since: 2.4
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#
339##
340{ 'command': 'query-rocker-of-dpa-groups',
341  'data': { 'name': 'str', '*type': 'uint8' },
342  'returns': ['RockerOfDpaGroup'] }
343