| 1 | # -*- Mode: Python -*- |
| 2 | # vim: filetype=python |
| 3 | |
| 4 | ## |
| 5 | # ******************** |
| 6 | # Rocker switch device |
| 7 | # ******************** |
| 8 | ## |
| 9 | |
| 10 | ## |
| 11 | # @RockerSwitch: |
| 12 | # |
| 13 | # Rocker switch information. |
| 14 | # |
| 15 | # @name: switch name |
| 16 | # |
| 17 | # @id: switch ID |
| 18 | # |
| 19 | # @ports: number of front-panel ports |
| 20 | # |
| 21 | # Since: 2.4 |
| 22 | ## |
| 23 | { 'struct': 'RockerSwitch', |
| 24 | 'data': { 'name': 'str', 'id': 'uint64', 'ports': 'uint32' } } |
| 25 | |
| 26 | ## |
| 27 | # @query-rocker: |
| 28 | # |
| 29 | # Return rocker switch information. |
| 30 | # |
| 31 | # @name: switch name |
| 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 | # Since: 2.4 |
| 102 | # |
| 103 | # .. qmp-example:: |
| 104 | # |
| 105 | # -> { "execute": "query-rocker-ports", "arguments": { "name": "sw1" } } |
| 106 | # <- { "return": [ {"duplex": "full", "enabled": true, "name": "sw1.1", |
| 107 | # "autoneg": "off", "link-up": true, "speed": 10000}, |
| 108 | # {"duplex": "full", "enabled": true, "name": "sw1.2", |
| 109 | # "autoneg": "off", "link-up": true, "speed": 10000} |
| 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 flow |
| 239 | # information for all tables. |
| 240 | # |
| 241 | # Returns: rocker OF-DPA flow information |
| 242 | # |
| 243 | # Since: 2.4 |
| 244 | # |
| 245 | # .. qmp-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 | # ... |
| 256 | # ]} |
| 257 | ## |
| 258 | { 'command': 'query-rocker-of-dpa-flows', |
| 259 | 'data': { 'name': 'str', '*tbl-id': 'uint32' }, |
| 260 | 'returns': ['RockerOfDpaFlow'] } |
| 261 | |
| 262 | ## |
| 263 | # @RockerOfDpaGroup: |
| 264 | # |
| 265 | # Rocker switch OF-DPA group |
| 266 | # |
| 267 | # @id: group unique ID |
| 268 | # |
| 269 | # @type: group type |
| 270 | # |
| 271 | # @vlan-id: VLAN ID |
| 272 | # |
| 273 | # @pport: physical port number |
| 274 | # |
| 275 | # @index: group index, unique with group type |
| 276 | # |
| 277 | # @out-pport: output physical port number |
| 278 | # |
| 279 | # @group-id: next group ID |
| 280 | # |
| 281 | # @set-vlan-id: VLAN ID to set |
| 282 | # |
| 283 | # @pop-vlan: pop VLAN headr from packet |
| 284 | # |
| 285 | # @group-ids: list of next group IDs |
| 286 | # |
| 287 | # @set-eth-src: set source MAC address in Ethernet header |
| 288 | # |
| 289 | # @set-eth-dst: set destination MAC address in Ethernet header |
| 290 | # |
| 291 | # @ttl-check: perform TTL check |
| 292 | # |
| 293 | # .. note:: Optional members may or may not appear in the group |
| 294 | # depending if they're relevant to the group type. |
| 295 | # |
| 296 | # Since: 2.4 |
| 297 | ## |
| 298 | { 'struct': 'RockerOfDpaGroup', |
| 299 | 'data': { 'id': 'uint32', 'type': 'uint8', '*vlan-id': 'uint16', |
| 300 | '*pport': 'uint32', '*index': 'uint32', '*out-pport': 'uint32', |
| 301 | '*group-id': 'uint32', '*set-vlan-id': 'uint16', |
| 302 | '*pop-vlan': 'uint8', '*group-ids': ['uint32'], |
| 303 | '*set-eth-src': 'str', '*set-eth-dst': 'str', |
| 304 | '*ttl-check': 'uint8' } } |
| 305 | |
| 306 | ## |
| 307 | # @query-rocker-of-dpa-groups: |
| 308 | # |
| 309 | # Return rocker OF-DPA group information. |
| 310 | # |
| 311 | # @name: switch name |
| 312 | # |
| 313 | # @type: group type. If type is not specified, returns group |
| 314 | # information for all group types. |
| 315 | # |
| 316 | # Returns: rocker OF-DPA group information |
| 317 | # |
| 318 | # Since: 2.4 |
| 319 | # |
| 320 | # .. qmp-example:: |
| 321 | # |
| 322 | # -> { "execute": "query-rocker-of-dpa-groups", |
| 323 | # "arguments": { "name": "sw1" } } |
| 324 | # <- { "return": [ {"type": 0, "out-pport": 2, |
| 325 | # "pport": 2, "vlan-id": 3841, |
| 326 | # "pop-vlan": 1, "id": 251723778}, |
| 327 | # {"type": 0, "out-pport": 0, |
| 328 | # "pport": 0, "vlan-id": 3841, |
| 329 | # "pop-vlan": 1, "id": 251723776}, |
| 330 | # {"type": 0, "out-pport": 1, |
| 331 | # "pport": 1, "vlan-id": 3840, |
| 332 | # "pop-vlan": 1, "id": 251658241}, |
| 333 | # {"type": 0, "out-pport": 0, |
| 334 | # "pport": 0, "vlan-id": 3840, |
| 335 | # "pop-vlan": 1, "id": 251658240} |
| 336 | # ]} |
| 337 | ## |
| 338 | { 'command': 'query-rocker-of-dpa-groups', |
| 339 | 'data': { 'name': 'str', '*type': 'uint8' }, |
| 340 | 'returns': ['RockerOfDpaGroup'] } |