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