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