rocker.json 7.8 KB

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