]> git.proxmox.com Git - mirror_qemu.git/blame - qapi/net.json
Merge tag 'pull-aspeed-20240201' of https://github.com/legoater/qemu into staging
[mirror_qemu.git] / qapi / net.json
CommitLineData
3c0bd37d 1# -*- Mode: Python -*-
f7160f32 2# vim: filetype=python
3c0bd37d
MA
3#
4
5##
6# = Net devices
7##
8
9{ 'include': 'common.json' }
5166fe0a 10{ 'include': 'sockets.json' }
3c0bd37d
MA
11
12##
13# @set_link:
14#
15# Sets the link status of a virtual network adapter.
16#
17# @name: the device name of the virtual network adapter
18#
19# @up: true to set the link status to be up
20#
ae7ccd50
MA
21# Returns:
22# - Nothing on success
23# - If @name is not a valid network device, DeviceNotFound
3c0bd37d 24#
9bc6e893 25# Since: 0.14
3c0bd37d 26#
a937b6aa
MA
27# Notes: Not all network adapters support setting link status. This
28# command will succeed even if the network adapter does not
29# support link status notification.
3c0bd37d
MA
30#
31# Example:
32#
33# -> { "execute": "set_link",
34# "arguments": { "name": "e1000.0", "up": false } }
35# <- { "return": {} }
3c0bd37d
MA
36##
37{ 'command': 'set_link', 'data': {'name': 'str', 'up': 'bool'} }
38
39##
40# @netdev_add:
41#
42# Add a network backend.
43#
3c0bd37d
MA
44# Additional arguments depend on the type.
45#
9bc6e893 46# Since: 0.14
3c0bd37d 47#
ae7ccd50
MA
48# Returns:
49# - Nothing on success
50# - If @type is not a valid network backend, DeviceNotFound
3c0bd37d
MA
51#
52# Example:
53#
54# -> { "execute": "netdev_add",
55# "arguments": { "type": "user", "id": "netdev1",
9a9d101c 56# "dnssearch": [ { "str": "example.org" } ] } }
3c0bd37d 57# <- { "return": {} }
3c0bd37d 58##
48f596c5
PB
59{ 'command': 'netdev_add', 'data': 'Netdev', 'boxed': true,
60 'allow-preconfig': true }
3c0bd37d
MA
61
62##
63# @netdev_del:
64#
65# Remove a network backend.
66#
67# @id: the name of the network backend to remove
68#
ae7ccd50
MA
69# Returns:
70# - Nothing on success
71# - If @id is not a valid network backend, DeviceNotFound
3c0bd37d 72#
9bc6e893 73# Since: 0.14
3c0bd37d
MA
74#
75# Example:
76#
77# -> { "execute": "netdev_del", "arguments": { "id": "netdev1" } }
78# <- { "return": {} }
3c0bd37d 79##
48f596c5
PB
80{ 'command': 'netdev_del', 'data': {'id': 'str'},
81 'allow-preconfig': true }
3c0bd37d 82
3c0bd37d
MA
83##
84# @NetLegacyNicOptions:
85#
86# Create a new Network Interface Card.
87#
88# @netdev: id of -netdev to connect to
89#
90# @macaddr: MAC address
91#
92# @model: device model (e1000, rtl8139, virtio etc.)
93#
94# @addr: PCI device address
95#
96# @vectors: number of MSI-x vectors, 0 to disable MSI-X
97#
98# Since: 1.2
99##
100{ 'struct': 'NetLegacyNicOptions',
101 'data': {
102 '*netdev': 'str',
103 '*macaddr': 'str',
104 '*model': 'str',
105 '*addr': 'str',
106 '*vectors': 'uint32' } }
107
108##
109# @NetdevUserOptions:
110#
a937b6aa
MA
111# Use the user mode network stack which requires no administrator
112# privilege to run.
3c0bd37d
MA
113#
114# @hostname: client hostname reported by the builtin DHCP server
115#
116# @restrict: isolate the guest from the host
117#
a937b6aa 118# @ipv4: whether to support IPv4, default true for enabled (since 2.6)
3c0bd37d 119#
a937b6aa 120# @ipv6: whether to support IPv6, default true for enabled (since 2.6)
3c0bd37d
MA
121#
122# @ip: legacy parameter, use net= instead
123#
a937b6aa
MA
124# @net: IP network address that the guest will see, in the form
125# addr[/netmask] The netmask is optional, and can be either in the
126# form a.b.c.d or as a number of valid top-most bits. Default is
127# 10.0.2.0/24.
3c0bd37d
MA
128#
129# @host: guest-visible address of the host
130#
131# @tftp: root directory of the built-in TFTP server
132#
133# @bootfile: BOOTP filename, for use with tftp=
134#
135# @dhcpstart: the first of the 16 IPs the built-in DHCP server can
a937b6aa 136# assign
3c0bd37d
MA
137#
138# @dns: guest-visible address of the virtual nameserver
139#
a937b6aa
MA
140# @dnssearch: list of DNS suffixes to search, passed as DHCP option to
141# the guest
3c0bd37d 142#
f18d1375 143# @domainname: guest-visible domain name of the virtual nameserver
a937b6aa 144# (since 3.0)
f18d1375 145#
a937b6aa
MA
146# @ipv6-prefix: IPv6 network prefix (default is fec0::) (since 2.6).
147# The network prefix is given in the usual hexadecimal IPv6
148# address notation.
3c0bd37d 149#
a937b6aa
MA
150# @ipv6-prefixlen: IPv6 network prefix length (default is 64) (since
151# 2.6)
3c0bd37d
MA
152#
153# @ipv6-host: guest-visible IPv6 address of the host (since 2.6)
154#
a937b6aa
MA
155# @ipv6-dns: guest-visible IPv6 address of the virtual nameserver
156# (since 2.6)
3c0bd37d
MA
157#
158# @smb: root directory of the built-in SMB server
159#
160# @smbserver: IP address of the built-in SMB server
161#
162# @hostfwd: redirect incoming TCP or UDP host connections to guest
a937b6aa 163# endpoints
3c0bd37d
MA
164#
165# @guestfwd: forward guest TCP connections
166#
0fca92b9
FZ
167# @tftp-server-name: RFC2132 "TFTP server name" string (Since 3.1)
168#
3c0bd37d
MA
169# Since: 1.2
170##
171{ 'struct': 'NetdevUserOptions',
172 'data': {
173 '*hostname': 'str',
174 '*restrict': 'bool',
175 '*ipv4': 'bool',
176 '*ipv6': 'bool',
177 '*ip': 'str',
178 '*net': 'str',
179 '*host': 'str',
180 '*tftp': 'str',
181 '*bootfile': 'str',
182 '*dhcpstart': 'str',
183 '*dns': 'str',
184 '*dnssearch': ['String'],
f18d1375 185 '*domainname': 'str',
3c0bd37d
MA
186 '*ipv6-prefix': 'str',
187 '*ipv6-prefixlen': 'int',
188 '*ipv6-host': 'str',
189 '*ipv6-dns': 'str',
190 '*smb': 'str',
191 '*smbserver': 'str',
192 '*hostfwd': ['String'],
0fca92b9
FZ
193 '*guestfwd': ['String'],
194 '*tftp-server-name': 'str' } }
3c0bd37d
MA
195
196##
197# @NetdevTapOptions:
198#
af1a5c3e 199# Used to configure a host TAP network interface backend.
3c0bd37d
MA
200#
201# @ifname: interface name
202#
203# @fd: file descriptor of an already opened tap
204#
205# @fds: multiple file descriptors of already opened multiqueue capable
a937b6aa 206# tap
3c0bd37d
MA
207#
208# @script: script to initialize the interface
209#
210# @downscript: script to shut down the interface
211#
212# @br: bridge name (since 2.8)
213#
214# @helper: command to execute to configure bridge
215#
a937b6aa 216# @sndbuf: send buffer limit. Understands [TGMKkb] suffixes.
3c0bd37d
MA
217#
218# @vnet_hdr: enable the IFF_VNET_HDR flag on the tap interface
219#
220# @vhost: enable vhost-net network accelerator
221#
222# @vhostfd: file descriptor of an already opened vhost net device
223#
224# @vhostfds: file descriptors of multiple already opened vhost net
a937b6aa 225# devices
3c0bd37d
MA
226#
227# @vhostforce: vhost on for non-MSIX virtio guests
228#
229# @queues: number of queues to be created for multiqueue capable tap
230#
a937b6aa
MA
231# @poll-us: maximum number of microseconds that could be spent on busy
232# polling for tap (since 2.7)
3c0bd37d
MA
233#
234# Since: 1.2
235##
236{ 'struct': 'NetdevTapOptions',
237 'data': {
238 '*ifname': 'str',
239 '*fd': 'str',
240 '*fds': 'str',
241 '*script': 'str',
242 '*downscript': 'str',
243 '*br': 'str',
244 '*helper': 'str',
245 '*sndbuf': 'size',
246 '*vnet_hdr': 'bool',
247 '*vhost': 'bool',
248 '*vhostfd': 'str',
249 '*vhostfds': 'str',
250 '*vhostforce': 'bool',
251 '*queues': 'uint32',
252 '*poll-us': 'uint32'} }
253
254##
255# @NetdevSocketOptions:
256#
af1a5c3e
TH
257# Socket netdevs are used to establish a network connection to another
258# QEMU virtual machine via a TCP socket.
3c0bd37d
MA
259#
260# @fd: file descriptor of an already opened socket
261#
262# @listen: port number, and optional hostname, to listen on
263#
264# @connect: port number, and optional hostname, to connect to
265#
266# @mcast: UDP multicast address and port number
267#
268# @localaddr: source address and port for multicast and udp packets
269#
270# @udp: UDP unicast address and port number
271#
272# Since: 1.2
273##
274{ 'struct': 'NetdevSocketOptions',
275 'data': {
276 '*fd': 'str',
277 '*listen': 'str',
278 '*connect': 'str',
279 '*mcast': 'str',
280 '*localaddr': 'str',
281 '*udp': 'str' } }
282
283##
284# @NetdevL2TPv3Options:
285#
af1a5c3e 286# Configure an Ethernet over L2TPv3 tunnel.
3c0bd37d
MA
287#
288# @src: source address
289#
290# @dst: destination address
291#
292# @srcport: source port - mandatory for udp, optional for ip
293#
294# @dstport: destination port - mandatory for udp, optional for ip
295#
296# @ipv6: force the use of ipv6
297#
298# @udp: use the udp version of l2tpv3 encapsulation
299#
118d4ed0 300# @cookie64: use 64 bit cookies
3c0bd37d
MA
301#
302# @counter: have sequence counter
303#
a937b6aa
MA
304# @pincounter: pin sequence counter to zero - workaround for buggy
305# implementations or networks with packet reorder
3c0bd37d
MA
306#
307# @txcookie: 32 or 64 bit transmit cookie
308#
309# @rxcookie: 32 or 64 bit receive cookie
310#
311# @txsession: 32 bit transmit session
312#
a937b6aa
MA
313# @rxsession: 32 bit receive session - if not specified set to the
314# same value as transmit
3c0bd37d 315#
a937b6aa
MA
316# @offset: additional offset - allows the insertion of additional
317# application-specific data before the packet payload
3c0bd37d
MA
318#
319# Since: 2.1
320##
321{ 'struct': 'NetdevL2TPv3Options',
322 'data': {
323 'src': 'str',
324 'dst': 'str',
325 '*srcport': 'str',
326 '*dstport': 'str',
327 '*ipv6': 'bool',
328 '*udp': 'bool',
329 '*cookie64': 'bool',
330 '*counter': 'bool',
331 '*pincounter': 'bool',
332 '*txcookie': 'uint64',
333 '*rxcookie': 'uint64',
334 'txsession': 'uint32',
335 '*rxsession': 'uint32',
336 '*offset': 'uint32' } }
337
338##
339# @NetdevVdeOptions:
340#
af1a5c3e 341# Connect to a vde switch running on the host.
3c0bd37d
MA
342#
343# @sock: socket path
344#
345# @port: port number
346#
347# @group: group owner of socket
348#
349# @mode: permissions for socket
350#
351# Since: 1.2
352##
353{ 'struct': 'NetdevVdeOptions',
354 'data': {
355 '*sock': 'str',
356 '*port': 'uint16',
357 '*group': 'str',
358 '*mode': 'uint16' } }
359
3c0bd37d
MA
360##
361# @NetdevBridgeOptions:
362#
363# Connect a host TAP network interface to a host bridge device.
364#
365# @br: bridge name
366#
367# @helper: command to execute to configure bridge
368#
369# Since: 1.2
370##
371{ 'struct': 'NetdevBridgeOptions',
372 'data': {
373 '*br': 'str',
374 '*helper': 'str' } }
375
376##
377# @NetdevHubPortOptions:
378#
379# Connect two or more net clients through a software hub.
380#
381# @hubid: hub identifier number
a937b6aa
MA
382#
383# @netdev: used to connect hub to a netdev instead of a device (since
384# 2.12)
3c0bd37d
MA
385#
386# Since: 1.2
387##
388{ 'struct': 'NetdevHubPortOptions',
389 'data': {
18d65d22
TH
390 'hubid': 'int32',
391 '*netdev': 'str' } }
3c0bd37d
MA
392
393##
394# @NetdevNetmapOptions:
395#
396# Connect a client to a netmap-enabled NIC or to a VALE switch port
397#
a937b6aa
MA
398# @ifname: Either the name of an existing network interface supported
399# by netmap, or the name of a VALE port (created on the fly). A
400# VALE port name is in the form 'valeXXX:YYY', where XXX and YYY
401# are non-negative integers. XXX identifies a switch and YYY
402# identifies a port of the switch. VALE ports having the same XXX
403# are therefore connected to the same switch.
3c0bd37d
MA
404#
405# @devname: path of the netmap device (default: '/dev/netmap').
406#
407# Since: 2.0
408##
409{ 'struct': 'NetdevNetmapOptions',
410 'data': {
411 'ifname': 'str',
412 '*devname': 'str' } }
413
cb039ef3
IM
414##
415# @AFXDPMode:
416#
417# Attach mode for a default XDP program
418#
419# @skb: generic mode, no driver support necessary
420#
421# @native: DRV mode, program is attached to a driver, packets are passed to
422# the socket without allocation of skb.
423#
424# Since: 8.2
425##
426{ 'enum': 'AFXDPMode',
427 'data': [ 'native', 'skb' ],
428 'if': 'CONFIG_AF_XDP' }
429
430##
431# @NetdevAFXDPOptions:
432#
433# AF_XDP network backend
434#
435# @ifname: The name of an existing network interface.
436#
437# @mode: Attach mode for a default XDP program. If not specified, then
438# 'native' will be tried first, then 'skb'.
439#
440# @force-copy: Force XDP copy mode even if device supports zero-copy.
441# (default: false)
442#
443# @queues: number of queues to be used for multiqueue interfaces (default: 1).
444#
445# @start-queue: Use @queues starting from this queue number (default: 0).
446#
447# @inhibit: Don't load a default XDP program, use one already loaded to
448# the interface (default: false). Requires @sock-fds.
449#
450# @sock-fds: A colon (:) separated list of file descriptors for already open
451# but not bound AF_XDP sockets in the queue order. One fd per queue.
452# These descriptors should already be added into XDP socket map for
453# corresponding queues. Requires @inhibit.
454#
455# Since: 8.2
456##
457{ 'struct': 'NetdevAFXDPOptions',
458 'data': {
459 'ifname': 'str',
460 '*mode': 'AFXDPMode',
461 '*force-copy': 'bool',
462 '*queues': 'int',
463 '*start-queue': 'int',
464 '*inhibit': 'bool',
465 '*sock-fds': 'str' },
466 'if': 'CONFIG_AF_XDP' }
467
3c0bd37d
MA
468##
469# @NetdevVhostUserOptions:
470#
471# Vhost-user network backend
472#
473# @chardev: name of a unix socket chardev
474#
475# @vhostforce: vhost on for non-MSIX virtio guests (default: false).
476#
477# @queues: number of queues to be created for multiqueue vhost-user
a937b6aa 478# (default: 1) (Since 2.5)
3c0bd37d
MA
479#
480# Since: 2.1
481##
482{ 'struct': 'NetdevVhostUserOptions',
483 'data': {
484 'chardev': 'str',
485 '*vhostforce': 'bool',
486 '*queues': 'int' } }
487
1e0a84ea
CL
488##
489# @NetdevVhostVDPAOptions:
490#
491# Vhost-vdpa network backend
492#
a937b6aa
MA
493# vDPA device is a device that uses a datapath which complies with the
494# virtio specifications with a vendor specific control path.
1e0a84ea 495#
a937b6aa 496# @vhostdev: path of vhost-vdpa device (default:'/dev/vhost-vdpa-0')
1e0a84ea 497#
8801ccd0
SWL
498# @vhostfd: file descriptor of an already opened vhost vdpa device
499#
1e0a84ea 500# @queues: number of queues to be created for multiqueue vhost-vdpa
a937b6aa 501# (default: 1)
1e0a84ea 502#
a937b6aa
MA
503# @x-svq: Start device with (experimental) shadow virtqueue. (Since
504# 7.1) (default: false)
1576dbb5
EP
505#
506# Features:
a937b6aa 507#
1576dbb5
EP
508# @unstable: Member @x-svq is experimental.
509#
1e0a84ea
CL
510# Since: 5.1
511##
512{ 'struct': 'NetdevVhostVDPAOptions',
513 'data': {
514 '*vhostdev': 'str',
8801ccd0 515 '*vhostfd': 'str',
1576dbb5
EP
516 '*queues': 'int',
517 '*x-svq': {'type': 'bool', 'features' : [ 'unstable'] } } }
1e0a84ea 518
81ad2964
VY
519##
520# @NetdevVmnetHostOptions:
521#
522# vmnet (host mode) network backend.
523#
524# Allows the vmnet interface to communicate with other vmnet
525# interfaces that are in host mode and also with the host.
526#
527# @start-address: The starting IPv4 address to use for the interface.
a937b6aa
MA
528# Must be in the private IP range (RFC 1918). Must be specified
529# along with @end-address and @subnet-mask. This address is used
530# as the gateway address. The subsequent address up to and
531# including end-address are placed in the DHCP pool.
81ad2964
VY
532#
533# @end-address: The DHCP IPv4 range end address to use for the
a937b6aa
MA
534# interface. Must be in the private IP range (RFC 1918). Must be
535# specified along with @start-address and @subnet-mask.
81ad2964 536#
a937b6aa
MA
537# @subnet-mask: The IPv4 subnet mask to use on the interface. Must be
538# specified along with @start-address and @subnet-mask.
81ad2964 539#
a937b6aa
MA
540# @isolated: Enable isolation for this interface. Interface isolation
541# ensures that vmnet interface is not able to communicate with any
542# other vmnet interfaces. Only communication with host is
543# allowed. Requires at least macOS Big Sur 11.0.
81ad2964
VY
544#
545# @net-uuid: The identifier (UUID) to uniquely identify the isolated
a937b6aa
MA
546# network vmnet interface should be added to. If set, no DHCP
547# service is provided for this interface and network communication
548# is allowed only with other interfaces added to this network
549# identified by the UUID. Requires at least macOS Big Sur 11.0.
81ad2964
VY
550#
551# Since: 7.1
552##
553{ 'struct': 'NetdevVmnetHostOptions',
554 'data': {
555 '*start-address': 'str',
556 '*end-address': 'str',
557 '*subnet-mask': 'str',
558 '*isolated': 'bool',
559 '*net-uuid': 'str' },
560 'if': 'CONFIG_VMNET' }
561
562##
563# @NetdevVmnetSharedOptions:
564#
565# vmnet (shared mode) network backend.
566#
567# Allows traffic originating from the vmnet interface to reach the
a937b6aa
MA
568# Internet through a network address translator (NAT). The vmnet
569# interface can communicate with the host and with other shared mode
570# interfaces on the same subnet. If no DHCP settings, subnet mask and
571# IPv6 prefix specified, the interface can communicate with any of
572# other interfaces in shared mode.
81ad2964
VY
573#
574# @start-address: The starting IPv4 address to use for the interface.
a937b6aa
MA
575# Must be in the private IP range (RFC 1918). Must be specified
576# along with @end-address and @subnet-mask. This address is used
577# as the gateway address. The subsequent address up to and
578# including end-address are placed in the DHCP pool.
81ad2964
VY
579#
580# @end-address: The DHCP IPv4 range end address to use for the
a937b6aa
MA
581# interface. Must be in the private IP range (RFC 1918). Must be
582# specified along with @start-address and @subnet-mask.
81ad2964 583#
a937b6aa
MA
584# @subnet-mask: The IPv4 subnet mask to use on the interface. Must be
585# specified along with @start-address and @subnet-mask.
81ad2964 586#
a937b6aa
MA
587# @isolated: Enable isolation for this interface. Interface isolation
588# ensures that vmnet interface is not able to communicate with any
589# other vmnet interfaces. Only communication with host is
590# allowed. Requires at least macOS Big Sur 11.0.
81ad2964 591#
a937b6aa
MA
592# @nat66-prefix: The IPv6 prefix to use into guest network. Must be a
593# unique local address i.e. start with fd00::/8 and have length of
594# 64.
81ad2964
VY
595#
596# Since: 7.1
597##
598{ 'struct': 'NetdevVmnetSharedOptions',
599 'data': {
600 '*start-address': 'str',
601 '*end-address': 'str',
602 '*subnet-mask': 'str',
603 '*isolated': 'bool',
604 '*nat66-prefix': 'str' },
605 'if': 'CONFIG_VMNET' }
606
607##
608# @NetdevVmnetBridgedOptions:
609#
610# vmnet (bridged mode) network backend.
611#
612# Bridges the vmnet interface with a physical network interface.
613#
614# @ifname: The name of the physical interface to be bridged.
615#
a937b6aa
MA
616# @isolated: Enable isolation for this interface. Interface isolation
617# ensures that vmnet interface is not able to communicate with any
618# other vmnet interfaces. Only communication with host is
619# allowed. Requires at least macOS Big Sur 11.0.
81ad2964
VY
620#
621# Since: 7.1
622##
623{ 'struct': 'NetdevVmnetBridgedOptions',
624 'data': {
625 'ifname': 'str',
626 '*isolated': 'bool' },
627 'if': 'CONFIG_VMNET' }
628
5166fe0a
LV
629##
630# @NetdevStreamOptions:
631#
632# Configuration info for stream socket netdev
633#
a937b6aa
MA
634# @addr: socket address to listen on (server=true) or connect to
635# (server=false)
636#
5166fe0a 637# @server: create server socket (default: false)
a937b6aa
MA
638#
639# @reconnect: For a client socket, if a socket is disconnected, then
640# attempt a reconnect after the given number of seconds. Setting
641# this to zero disables this function. (default: 0) (since 8.0)
5166fe0a 642#
13c6be96 643# Only SocketAddress types 'unix', 'inet' and 'fd' are supported.
5166fe0a
LV
644#
645# Since: 7.2
646##
647{ 'struct': 'NetdevStreamOptions',
648 'data': {
649 'addr': 'SocketAddress',
148fbf0d
LV
650 '*server': 'bool',
651 '*reconnect': 'uint32' } }
5166fe0a
LV
652
653##
654# @NetdevDgramOptions:
655#
656# Configuration info for datagram socket netdev.
657#
658# @remote: remote address
a937b6aa 659#
5166fe0a
LV
660# @local: local address
661#
784e7a25 662# Only SocketAddress types 'unix', 'inet' and 'fd' are supported.
5166fe0a 663#
a937b6aa
MA
664# If remote address is present and it's a multicast address, local
665# address is optional. Otherwise local address is required and remote
666# address is optional.
5166fe0a
LV
667#
668# .. table:: Valid parameters combination table
669# :widths: auto
670#
671# ============= ======== =====
672# remote local okay?
673# ============= ======== =====
674# absent absent no
675# absent not fd no
676# absent fd yes
677# multicast absent yes
678# multicast present yes
679# not multicast absent no
680# not multicast present yes
681# ============= ======== =====
682#
683# Since: 7.2
684##
685{ 'struct': 'NetdevDgramOptions',
686 'data': {
687 '*local': 'SocketAddress',
688 '*remote': 'SocketAddress' } }
689
3c0bd37d
MA
690##
691# @NetClientDriver:
692#
693# Available netdev drivers.
694#
86bf13ae
MA
695# @l2tpv3: since 2.1
696# @vhost-vdpa: since 5.1
697# @vmnet-host: since 7.1
698# @vmnet-shared: since 7.1
699# @vmnet-bridged: since 7.1
700# @stream: since 7.2
701# @dgram: since 7.2
cb039ef3 702# @af-xdp: since 8.2
1e0a84ea 703#
86bf13ae 704# Since: 2.7
3c0bd37d
MA
705##
706{ 'enum': 'NetClientDriver',
5166fe0a
LV
707 'data': [ 'none', 'nic', 'user', 'tap', 'l2tpv3', 'socket', 'stream',
708 'dgram', 'vde', 'bridge', 'hubport', 'netmap', 'vhost-user',
709 'vhost-vdpa',
cb039ef3 710 { 'name': 'af-xdp', 'if': 'CONFIG_AF_XDP' },
81ad2964
VY
711 { 'name': 'vmnet-host', 'if': 'CONFIG_VMNET' },
712 { 'name': 'vmnet-shared', 'if': 'CONFIG_VMNET' },
713 { 'name': 'vmnet-bridged', 'if': 'CONFIG_VMNET' }] }
3c0bd37d
MA
714
715##
716# @Netdev:
717#
718# Captures the configuration of a network device.
719#
720# @id: identifier for monitor commands.
721#
722# @type: Specify the driver used for interpreting remaining arguments.
723#
724# Since: 1.2
3c0bd37d
MA
725##
726{ 'union': 'Netdev',
727 'base': { 'id': 'str', 'type': 'NetClientDriver' },
728 'discriminator': 'type',
729 'data': {
3c0bd37d
MA
730 'nic': 'NetLegacyNicOptions',
731 'user': 'NetdevUserOptions',
732 'tap': 'NetdevTapOptions',
733 'l2tpv3': 'NetdevL2TPv3Options',
734 'socket': 'NetdevSocketOptions',
5166fe0a
LV
735 'stream': 'NetdevStreamOptions',
736 'dgram': 'NetdevDgramOptions',
3c0bd37d 737 'vde': 'NetdevVdeOptions',
3c0bd37d
MA
738 'bridge': 'NetdevBridgeOptions',
739 'hubport': 'NetdevHubPortOptions',
740 'netmap': 'NetdevNetmapOptions',
cb039ef3
IM
741 'af-xdp': { 'type': 'NetdevAFXDPOptions',
742 'if': 'CONFIG_AF_XDP' },
1e0a84ea 743 'vhost-user': 'NetdevVhostUserOptions',
81ad2964
VY
744 'vhost-vdpa': 'NetdevVhostVDPAOptions',
745 'vmnet-host': { 'type': 'NetdevVmnetHostOptions',
746 'if': 'CONFIG_VMNET' },
747 'vmnet-shared': { 'type': 'NetdevVmnetSharedOptions',
748 'if': 'CONFIG_VMNET' },
749 'vmnet-bridged': { 'type': 'NetdevVmnetBridgedOptions',
750 'if': 'CONFIG_VMNET' } } }
3c0bd37d 751
3c0bd37d
MA
752##
753# @RxState:
754#
755# Packets receiving state
756#
757# @normal: filter assigned packets according to the mac-table
758#
759# @none: don't receive any assigned packet
760#
761# @all: receive all assigned packets
762#
763# Since: 1.6
764##
765{ 'enum': 'RxState', 'data': [ 'normal', 'none', 'all' ] }
766
767##
768# @RxFilterInfo:
769#
770# Rx-filter information for a NIC.
771#
772# @name: net client name
773#
774# @promiscuous: whether promiscuous mode is enabled
775#
776# @multicast: multicast receive state
777#
778# @unicast: unicast receive state
779#
780# @vlan: vlan receive state (Since 2.0)
781#
782# @broadcast-allowed: whether to receive broadcast
783#
784# @multicast-overflow: multicast table is overflowed or not
785#
786# @unicast-overflow: unicast table is overflowed or not
787#
788# @main-mac: the main macaddr string
789#
790# @vlan-table: a list of active vlan id
791#
792# @unicast-table: a list of unicast macaddr string
793#
794# @multicast-table: a list of multicast macaddr string
795#
796# Since: 1.6
797##
798{ 'struct': 'RxFilterInfo',
799 'data': {
800 'name': 'str',
801 'promiscuous': 'bool',
802 'multicast': 'RxState',
803 'unicast': 'RxState',
804 'vlan': 'RxState',
805 'broadcast-allowed': 'bool',
806 'multicast-overflow': 'bool',
807 'unicast-overflow': 'bool',
808 'main-mac': 'str',
809 'vlan-table': ['int'],
810 'unicast-table': ['str'],
811 'multicast-table': ['str'] }}
812
813##
814# @query-rx-filter:
815#
816# Return rx-filter information for all NICs (or for the given NIC).
817#
818# @name: net client name
819#
820# Returns: list of @RxFilterInfo for all NICs (or for the given NIC).
a937b6aa
MA
821# Returns an error if the given @name doesn't exist, or given NIC
822# doesn't support rx-filter querying, or given net client isn't a
823# NIC.
3c0bd37d
MA
824#
825# Since: 1.6
826#
827# Example:
828#
829# -> { "execute": "query-rx-filter", "arguments": { "name": "vnet0" } }
830# <- { "return": [
831# {
832# "promiscuous": true,
833# "name": "vnet0",
834# "main-mac": "52:54:00:12:34:56",
835# "unicast": "normal",
836# "vlan": "normal",
837# "vlan-table": [
838# 4,
839# 0
840# ],
841# "unicast-table": [
842# ],
843# "multicast": "normal",
844# "multicast-overflow": false,
845# "unicast-overflow": false,
846# "multicast-table": [
847# "01:00:5e:00:00:01",
848# "33:33:00:00:00:01",
849# "33:33:ff:12:34:56"
850# ],
851# "broadcast-allowed": false
852# }
853# ]
854# }
3c0bd37d 855##
b0ddeba2
MAL
856{ 'command': 'query-rx-filter',
857 'data': { '*name': 'str' },
3c0bd37d
MA
858 'returns': ['RxFilterInfo'] }
859
860##
861# @NIC_RX_FILTER_CHANGED:
862#
a937b6aa
MA
863# Emitted once until the 'query-rx-filter' command is executed, the
864# first event will always be emitted
3c0bd37d
MA
865#
866# @name: net client name
867#
868# @path: device path
869#
870# Since: 1.6
871#
872# Example:
873#
874# <- { "event": "NIC_RX_FILTER_CHANGED",
875# "data": { "name": "vnet0",
876# "path": "/machine/peripheral/vnet0/virtio-backend" },
877# "timestamp": { "seconds": 1368697518, "microseconds": 326866 } }
3c0bd37d
MA
878##
879{ 'event': 'NIC_RX_FILTER_CHANGED',
880 'data': { '*name': 'str', 'path': 'str' } }
50510ea2
DDAG
881
882##
883# @AnnounceParameters:
884#
885# Parameters for self-announce timers
886#
887# @initial: Initial delay (in ms) before sending the first GARP/RARP
a937b6aa 888# announcement
50510ea2
DDAG
889#
890# @max: Maximum delay (in ms) between GARP/RARP announcement packets
891#
892# @rounds: Number of self-announcement attempts
893#
894# @step: Delay increase (in ms) after each self-announcement attempt
895#
a937b6aa
MA
896# @interfaces: An optional list of interface names, which restricts
897# the announcement to the listed interfaces. (Since 4.1)
ef2fdbfb 898#
944458b6 899# @id: A name to be used to identify an instance of announce-timers
a937b6aa
MA
900# and to allow it to modified later. Not for use as part of the
901# migration parameters. (Since 4.1)
944458b6 902#
50510ea2
DDAG
903# Since: 4.0
904##
905
906{ 'struct': 'AnnounceParameters',
907 'data': { 'initial': 'int',
908 'max': 'int',
909 'rounds': 'int',
ef2fdbfb 910 'step': 'int',
944458b6
DDAG
911 '*interfaces': ['str'],
912 '*id' : 'str' } }
a06cd488
DDAG
913
914##
915# @announce-self:
916#
a937b6aa
MA
917# Trigger generation of broadcast RARP frames to update network
918# switches. This can be useful when network bonds fail-over the
919# active slave.
a06cd488 920#
a06cd488
DDAG
921# Example:
922#
ef2fdbfb 923# -> { "execute": "announce-self",
a06cd488 924# "arguments": {
ef2fdbfb 925# "initial": 50, "max": 550, "rounds": 10, "step": 50,
944458b6 926# "interfaces": ["vn2", "vn3"], "id": "bob" } }
a06cd488
DDAG
927# <- { "return": {} }
928#
929# Since: 4.0
930##
931{ 'command': 'announce-self', 'boxed': true,
932 'data' : 'AnnounceParameters'}
70d04971
JF
933
934##
935# @FAILOVER_NEGOTIATED:
936#
a937b6aa
MA
937# Emitted when VIRTIO_NET_F_STANDBY was enabled during feature
938# negotiation. Failover primary devices which were hidden (not
939# hotplugged when requested) before will now be hotplugged by the
940# virtio-net standby device.
70d04971 941#
121c25b0
VT
942# @device-id: QEMU device id of the unplugged device
943#
70d04971
JF
944# Since: 4.2
945#
946# Example:
947#
948# <- { "event": "FAILOVER_NEGOTIATED",
121c25b0
VT
949# "data": { "device-id": "net1" },
950# "timestamp": { "seconds": 1368697518, "microseconds": 326866 } }
70d04971
JF
951##
952{ 'event': 'FAILOVER_NEGOTIATED',
953 'data': {'device-id': 'str'} }
e506fee8
LV
954
955##
956# @NETDEV_STREAM_CONNECTED:
957#
958# Emitted when the netdev stream backend is connected
959#
960# @netdev-id: QEMU netdev id that is connected
a937b6aa 961#
e506fee8
LV
962# @addr: The destination address
963#
964# Since: 7.2
965#
37fa48a4 966# Examples:
e506fee8
LV
967#
968# <- { "event": "NETDEV_STREAM_CONNECTED",
969# "data": { "netdev-id": "netdev0",
970# "addr": { "port": "47666", "ipv6": true,
971# "host": "::1", "type": "inet" } },
972# "timestamp": { "seconds": 1666269863, "microseconds": 311222 } }
973#
e506fee8
LV
974# <- { "event": "NETDEV_STREAM_CONNECTED",
975# "data": { "netdev-id": "netdev0",
976# "addr": { "path": "/tmp/qemu0", "type": "unix" } },
977# "timestamp": { "seconds": 1666269706, "microseconds": 413651 } }
e506fee8
LV
978##
979{ 'event': 'NETDEV_STREAM_CONNECTED',
980 'data': { 'netdev-id': 'str',
981 'addr': 'SocketAddress' } }
982
983##
984# @NETDEV_STREAM_DISCONNECTED:
985#
986# Emitted when the netdev stream backend is disconnected
987#
988# @netdev-id: QEMU netdev id that is disconnected
989#
990# Since: 7.2
991#
992# Example:
993#
994# <- { 'event': 'NETDEV_STREAM_DISCONNECTED',
995# 'data': {'netdev-id': 'netdev0'},
996# 'timestamp': {'seconds': 1663330937, 'microseconds': 526695} }
e506fee8
LV
997##
998{ 'event': 'NETDEV_STREAM_DISCONNECTED',
999 'data': { 'netdev-id': 'str' } }