fpu_helper.c: fix helper_fpscr_clrbit() function
[qemu/ar7.git] / qapi / net.json
blob6b7d93cb59eec0d4e72b7a1fe2f1f421ff56234e
1 # -*- Mode: Python -*-
4 ##
5 # = Net devices
6 ##
8 { 'include': 'common.json' }
11 # @set_link:
13 # Sets the link status of a virtual network adapter.
15 # @name: the device name of the virtual network adapter
17 # @up: true to set the link status to be up
19 # Returns: Nothing on success
20 #          If @name is not a valid network device, DeviceNotFound
22 # Since: 0.14.0
24 # Notes: Not all network adapters support setting link status.  This command
25 #        will succeed even if the network adapter does not support link status
26 #        notification.
28 # Example:
30 # -> { "execute": "set_link",
31 #      "arguments": { "name": "e1000.0", "up": false } }
32 # <- { "return": {} }
35 { 'command': 'set_link', 'data': {'name': 'str', 'up': 'bool'} }
38 # @netdev_add:
40 # Add a network backend.
42 # @type: the type of network backend. Possible values are listed in
43 #        NetClientDriver (excluding 'none' and 'nic')
45 # @id: the name of the new network backend
47 # Additional arguments depend on the type.
49 # TODO: This command effectively bypasses QAPI completely due to its
50 # "additional arguments" business.  It shouldn't have been added to
51 # the schema in this form.  It should be qapified properly, or
52 # replaced by a properly qapified command.
54 # Since: 0.14.0
56 # Returns: Nothing on success
57 #          If @type is not a valid network backend, DeviceNotFound
59 # Example:
61 # -> { "execute": "netdev_add",
62 #      "arguments": { "type": "user", "id": "netdev1",
63 #                     "dnssearch": "example.org" } }
64 # <- { "return": {} }
67 { 'command': 'netdev_add',
68   'data': {'type': 'str', 'id': 'str'},
69   'gen': false }                # so we can get the additional arguments
72 # @netdev_del:
74 # Remove a network backend.
76 # @id: the name of the network backend to remove
78 # Returns: Nothing on success
79 #          If @id is not a valid network backend, DeviceNotFound
81 # Since: 0.14.0
83 # Example:
85 # -> { "execute": "netdev_del", "arguments": { "id": "netdev1" } }
86 # <- { "return": {} }
89 { 'command': 'netdev_del', 'data': {'id': 'str'} }
92 # @NetdevNoneOptions:
94 # Use it alone to have zero network devices.
96 # Since: 1.2
98 { 'struct': 'NetdevNoneOptions',
99   'data': { } }
102 # @NetLegacyNicOptions:
104 # Create a new Network Interface Card.
106 # @netdev: id of -netdev to connect to
108 # @macaddr: MAC address
110 # @model: device model (e1000, rtl8139, virtio etc.)
112 # @addr: PCI device address
114 # @vectors: number of MSI-x vectors, 0 to disable MSI-X
116 # Since: 1.2
118 { 'struct': 'NetLegacyNicOptions',
119   'data': {
120     '*netdev':  'str',
121     '*macaddr': 'str',
122     '*model':   'str',
123     '*addr':    'str',
124     '*vectors': 'uint32' } }
127 # @NetdevUserOptions:
129 # Use the user mode network stack which requires no administrator privilege to
130 # run.
132 # @hostname: client hostname reported by the builtin DHCP server
134 # @restrict: isolate the guest from the host
136 # @ipv4: whether to support IPv4, default true for enabled
137 #        (since 2.6)
139 # @ipv6: whether to support IPv6, default true for enabled
140 #        (since 2.6)
142 # @ip: legacy parameter, use net= instead
144 # @net: IP network address that the guest will see, in the
145 #       form addr[/netmask] The netmask is optional, and can be
146 #       either in the form a.b.c.d or as a number of valid top-most
147 #       bits. Default is 10.0.2.0/24.
149 # @host: guest-visible address of the host
151 # @tftp: root directory of the built-in TFTP server
153 # @bootfile: BOOTP filename, for use with tftp=
155 # @dhcpstart: the first of the 16 IPs the built-in DHCP server can
156 #             assign
158 # @dns: guest-visible address of the virtual nameserver
160 # @dnssearch: list of DNS suffixes to search, passed as DHCP option
161 #             to the guest
163 # @domainname: guest-visible domain name of the virtual nameserver
164 #              (since 3.0)
166 # @ipv6-prefix: IPv6 network prefix (default is fec0::) (since
167 #               2.6). The network prefix is given in the usual
168 #               hexadecimal IPv6 address notation.
170 # @ipv6-prefixlen: IPv6 network prefix length (default is 64)
171 #                  (since 2.6)
173 # @ipv6-host: guest-visible IPv6 address of the host (since 2.6)
175 # @ipv6-dns: guest-visible IPv6 address of the virtual
176 #            nameserver (since 2.6)
178 # @smb: root directory of the built-in SMB server
180 # @smbserver: IP address of the built-in SMB server
182 # @hostfwd: redirect incoming TCP or UDP host connections to guest
183 #           endpoints
185 # @guestfwd: forward guest TCP connections
187 # Since: 1.2
189 { 'struct': 'NetdevUserOptions',
190   'data': {
191     '*hostname':  'str',
192     '*restrict':  'bool',
193     '*ipv4':      'bool',
194     '*ipv6':      'bool',
195     '*ip':        'str',
196     '*net':       'str',
197     '*host':      'str',
198     '*tftp':      'str',
199     '*bootfile':  'str',
200     '*dhcpstart': 'str',
201     '*dns':       'str',
202     '*dnssearch': ['String'],
203     '*domainname': 'str',
204     '*ipv6-prefix':      'str',
205     '*ipv6-prefixlen':   'int',
206     '*ipv6-host':        'str',
207     '*ipv6-dns':         'str',
208     '*smb':       'str',
209     '*smbserver': 'str',
210     '*hostfwd':   ['String'],
211     '*guestfwd':  ['String'] } }
214 # @NetdevTapOptions:
216 # Used to configure a host TAP network interface backend.
218 # @ifname: interface name
220 # @fd: file descriptor of an already opened tap
222 # @fds: multiple file descriptors of already opened multiqueue capable
223 # tap
225 # @script: script to initialize the interface
227 # @downscript: script to shut down the interface
229 # @br: bridge name (since 2.8)
231 # @helper: command to execute to configure bridge
233 # @sndbuf: send buffer limit. Understands [TGMKkb] suffixes.
235 # @vnet_hdr: enable the IFF_VNET_HDR flag on the tap interface
237 # @vhost: enable vhost-net network accelerator
239 # @vhostfd: file descriptor of an already opened vhost net device
241 # @vhostfds: file descriptors of multiple already opened vhost net
242 # devices
244 # @vhostforce: vhost on for non-MSIX virtio guests
246 # @queues: number of queues to be created for multiqueue capable tap
248 # @poll-us: maximum number of microseconds that could
249 # be spent on busy polling for tap (since 2.7)
251 # Since: 1.2
253 { 'struct': 'NetdevTapOptions',
254   'data': {
255     '*ifname':     'str',
256     '*fd':         'str',
257     '*fds':        'str',
258     '*script':     'str',
259     '*downscript': 'str',
260     '*br':         'str',
261     '*helper':     'str',
262     '*sndbuf':     'size',
263     '*vnet_hdr':   'bool',
264     '*vhost':      'bool',
265     '*vhostfd':    'str',
266     '*vhostfds':   'str',
267     '*vhostforce': 'bool',
268     '*queues':     'uint32',
269     '*poll-us':    'uint32'} }
272 # @NetdevSocketOptions:
274 # Socket netdevs are used to establish a network connection to another
275 # QEMU virtual machine via a TCP socket.
277 # @fd: file descriptor of an already opened socket
279 # @listen: port number, and optional hostname, to listen on
281 # @connect: port number, and optional hostname, to connect to
283 # @mcast: UDP multicast address and port number
285 # @localaddr: source address and port for multicast and udp packets
287 # @udp: UDP unicast address and port number
289 # Since: 1.2
291 { 'struct': 'NetdevSocketOptions',
292   'data': {
293     '*fd':        'str',
294     '*listen':    'str',
295     '*connect':   'str',
296     '*mcast':     'str',
297     '*localaddr': 'str',
298     '*udp':       'str' } }
301 # @NetdevL2TPv3Options:
303 # Configure an Ethernet over L2TPv3 tunnel.
305 # @src: source address
307 # @dst: destination address
309 # @srcport: source port - mandatory for udp, optional for ip
311 # @dstport: destination port - mandatory for udp, optional for ip
313 # @ipv6: force the use of ipv6
315 # @udp: use the udp version of l2tpv3 encapsulation
317 # @cookie64: use 64 bit coookies
319 # @counter: have sequence counter
321 # @pincounter: pin sequence counter to zero -
322 #              workaround for buggy implementations or
323 #              networks with packet reorder
325 # @txcookie: 32 or 64 bit transmit cookie
327 # @rxcookie: 32 or 64 bit receive cookie
329 # @txsession: 32 bit transmit session
331 # @rxsession: 32 bit receive session - if not specified
332 #             set to the same value as transmit
334 # @offset: additional offset - allows the insertion of
335 #          additional application-specific data before the packet payload
337 # Since: 2.1
339 { 'struct': 'NetdevL2TPv3Options',
340   'data': {
341     'src':          'str',
342     'dst':          'str',
343     '*srcport':     'str',
344     '*dstport':     'str',
345     '*ipv6':        'bool',
346     '*udp':         'bool',
347     '*cookie64':    'bool',
348     '*counter':     'bool',
349     '*pincounter':  'bool',
350     '*txcookie':    'uint64',
351     '*rxcookie':    'uint64',
352     'txsession':    'uint32',
353     '*rxsession':   'uint32',
354     '*offset':      'uint32' } }
357 # @NetdevVdeOptions:
359 # Connect to a vde switch running on the host.
361 # @sock: socket path
363 # @port: port number
365 # @group: group owner of socket
367 # @mode: permissions for socket
369 # Since: 1.2
371 { 'struct': 'NetdevVdeOptions',
372   'data': {
373     '*sock':  'str',
374     '*port':  'uint16',
375     '*group': 'str',
376     '*mode':  'uint16' } }
379 # @NetdevBridgeOptions:
381 # Connect a host TAP network interface to a host bridge device.
383 # @br: bridge name
385 # @helper: command to execute to configure bridge
387 # Since: 1.2
389 { 'struct': 'NetdevBridgeOptions',
390   'data': {
391     '*br':     'str',
392     '*helper': 'str' } }
395 # @NetdevHubPortOptions:
397 # Connect two or more net clients through a software hub.
399 # @hubid: hub identifier number
400 # @netdev: used to connect hub to a netdev instead of a device (since 2.12)
402 # Since: 1.2
404 { 'struct': 'NetdevHubPortOptions',
405   'data': {
406     'hubid':     'int32',
407     '*netdev':    'str' } }
410 # @NetdevNetmapOptions:
412 # Connect a client to a netmap-enabled NIC or to a VALE switch port
414 # @ifname: Either the name of an existing network interface supported by
415 #          netmap, or the name of a VALE port (created on the fly).
416 #          A VALE port name is in the form 'valeXXX:YYY', where XXX and
417 #          YYY are non-negative integers. XXX identifies a switch and
418 #          YYY identifies a port of the switch. VALE ports having the
419 #          same XXX are therefore connected to the same switch.
421 # @devname: path of the netmap device (default: '/dev/netmap').
423 # Since: 2.0
425 { 'struct': 'NetdevNetmapOptions',
426   'data': {
427     'ifname':     'str',
428     '*devname':    'str' } }
431 # @NetdevVhostUserOptions:
433 # Vhost-user network backend
435 # @chardev: name of a unix socket chardev
437 # @vhostforce: vhost on for non-MSIX virtio guests (default: false).
439 # @queues: number of queues to be created for multiqueue vhost-user
440 #          (default: 1) (Since 2.5)
442 # Since: 2.1
444 { 'struct': 'NetdevVhostUserOptions',
445   'data': {
446     'chardev':        'str',
447     '*vhostforce':    'bool',
448     '*queues':        'int' } }
451 # @NetClientDriver:
453 # Available netdev drivers.
455 # Since: 2.7
457 # 'dump': dropped in 2.12
459 { 'enum': 'NetClientDriver',
460   'data': [ 'none', 'nic', 'user', 'tap', 'l2tpv3', 'socket', 'vde',
461             'bridge', 'hubport', 'netmap', 'vhost-user' ] }
464 # @Netdev:
466 # Captures the configuration of a network device.
468 # @id: identifier for monitor commands.
470 # @type: Specify the driver used for interpreting remaining arguments.
472 # Since: 1.2
474 # 'l2tpv3' - since 2.1
476 { 'union': 'Netdev',
477   'base': { 'id': 'str', 'type': 'NetClientDriver' },
478   'discriminator': 'type',
479   'data': {
480     'none':     'NetdevNoneOptions',
481     'nic':      'NetLegacyNicOptions',
482     'user':     'NetdevUserOptions',
483     'tap':      'NetdevTapOptions',
484     'l2tpv3':   'NetdevL2TPv3Options',
485     'socket':   'NetdevSocketOptions',
486     'vde':      'NetdevVdeOptions',
487     'bridge':   'NetdevBridgeOptions',
488     'hubport':  'NetdevHubPortOptions',
489     'netmap':   'NetdevNetmapOptions',
490     'vhost-user': 'NetdevVhostUserOptions' } }
493 # @NetLegacy:
495 # Captures the configuration of a network device; legacy.
497 # @id: identifier for monitor commands
499 # @name: identifier for monitor commands, ignored if @id is present
501 # @opts: device type specific properties (legacy)
503 # Since: 1.2
505 # 'vlan': dropped in 3.0
507 { 'struct': 'NetLegacy',
508   'data': {
509     '*id':   'str',
510     '*name': 'str',
511     'opts':  'NetLegacyOptions' } }
514 # @NetLegacyOptionsType:
516 # Since: 1.2
518 { 'enum': 'NetLegacyOptionsType',
519   'data': ['none', 'nic', 'user', 'tap', 'l2tpv3', 'socket', 'vde',
520            'bridge', 'netmap', 'vhost-user'] }
523 # @NetLegacyOptions:
525 # Like Netdev, but for use only by the legacy command line options
527 # Since: 1.2
529 { 'union': 'NetLegacyOptions',
530   'base': { 'type': 'NetLegacyOptionsType' },
531   'discriminator': 'type',
532   'data': {
533     'none':     'NetdevNoneOptions',
534     'nic':      'NetLegacyNicOptions',
535     'user':     'NetdevUserOptions',
536     'tap':      'NetdevTapOptions',
537     'l2tpv3':   'NetdevL2TPv3Options',
538     'socket':   'NetdevSocketOptions',
539     'vde':      'NetdevVdeOptions',
540     'bridge':   'NetdevBridgeOptions',
541     'netmap':   'NetdevNetmapOptions',
542     'vhost-user': 'NetdevVhostUserOptions' } }
545 # @NetFilterDirection:
547 # Indicates whether a netfilter is attached to a netdev's transmit queue or
548 # receive queue or both.
550 # @all: the filter is attached both to the receive and the transmit
551 #       queue of the netdev (default).
553 # @rx: the filter is attached to the receive queue of the netdev,
554 #      where it will receive packets sent to the netdev.
556 # @tx: the filter is attached to the transmit queue of the netdev,
557 #      where it will receive packets sent by the netdev.
559 # Since: 2.5
561 { 'enum': 'NetFilterDirection',
562   'data': [ 'all', 'rx', 'tx' ] }
565 # @RxState:
567 # Packets receiving state
569 # @normal: filter assigned packets according to the mac-table
571 # @none: don't receive any assigned packet
573 # @all: receive all assigned packets
575 # Since: 1.6
577 { 'enum': 'RxState', 'data': [ 'normal', 'none', 'all' ] }
580 # @RxFilterInfo:
582 # Rx-filter information for a NIC.
584 # @name: net client name
586 # @promiscuous: whether promiscuous mode is enabled
588 # @multicast: multicast receive state
590 # @unicast: unicast receive state
592 # @vlan: vlan receive state (Since 2.0)
594 # @broadcast-allowed: whether to receive broadcast
596 # @multicast-overflow: multicast table is overflowed or not
598 # @unicast-overflow: unicast table is overflowed or not
600 # @main-mac: the main macaddr string
602 # @vlan-table: a list of active vlan id
604 # @unicast-table: a list of unicast macaddr string
606 # @multicast-table: a list of multicast macaddr string
608 # Since: 1.6
610 { 'struct': 'RxFilterInfo',
611   'data': {
612     'name':               'str',
613     'promiscuous':        'bool',
614     'multicast':          'RxState',
615     'unicast':            'RxState',
616     'vlan':               'RxState',
617     'broadcast-allowed':  'bool',
618     'multicast-overflow': 'bool',
619     'unicast-overflow':   'bool',
620     'main-mac':           'str',
621     'vlan-table':         ['int'],
622     'unicast-table':      ['str'],
623     'multicast-table':    ['str'] }}
626 # @query-rx-filter:
628 # Return rx-filter information for all NICs (or for the given NIC).
630 # @name: net client name
632 # Returns: list of @RxFilterInfo for all NICs (or for the given NIC).
633 #          Returns an error if the given @name doesn't exist, or given
634 #          NIC doesn't support rx-filter querying, or given net client
635 #          isn't a NIC.
637 # Since: 1.6
639 # Example:
641 # -> { "execute": "query-rx-filter", "arguments": { "name": "vnet0" } }
642 # <- { "return": [
643 #         {
644 #             "promiscuous": true,
645 #             "name": "vnet0",
646 #             "main-mac": "52:54:00:12:34:56",
647 #             "unicast": "normal",
648 #             "vlan": "normal",
649 #             "vlan-table": [
650 #                 4,
651 #                 0
652 #             ],
653 #             "unicast-table": [
654 #             ],
655 #             "multicast": "normal",
656 #             "multicast-overflow": false,
657 #             "unicast-overflow": false,
658 #             "multicast-table": [
659 #                 "01:00:5e:00:00:01",
660 #                 "33:33:00:00:00:01",
661 #                 "33:33:ff:12:34:56"
662 #             ],
663 #             "broadcast-allowed": false
664 #         }
665 #       ]
666 #    }
669 { 'command': 'query-rx-filter', 'data': { '*name': 'str' },
670   'returns': ['RxFilterInfo'] }
673 # @NIC_RX_FILTER_CHANGED:
675 # Emitted once until the 'query-rx-filter' command is executed, the first event
676 # will always be emitted
678 # @name: net client name
680 # @path: device path
682 # Since: 1.6
684 # Example:
686 # <- { "event": "NIC_RX_FILTER_CHANGED",
687 #      "data": { "name": "vnet0",
688 #                "path": "/machine/peripheral/vnet0/virtio-backend" },
689 #      "timestamp": { "seconds": 1368697518, "microseconds": 326866 } }
690 #    }
693 { 'event': 'NIC_RX_FILTER_CHANGED',
694   'data': { '*name': 'str', 'path': 'str' } }