]> git.proxmox.com Git - mirror_qemu.git/blame - qapi/sockets.json
Merge tag 'pull-maintainer-may24-160524-2' of https://gitlab.com/stsquad/qemu into...
[mirror_qemu.git] / qapi / sockets.json
CommitLineData
a2ff5a48 1# -*- Mode: Python -*-
f7160f32 2# vim: filetype=python
a2ff5a48
MA
3
4##
5# = Socket data types
6##
7
a2ff5a48
MA
8##
9# @NetworkAddressFamily:
10#
11# The network address family
12#
13# @ipv4: IPV4 family
14#
15# @ipv6: IPV6 family
16#
17# @unix: unix socket
18#
19# @vsock: vsock family (since 2.8)
20#
21# @unknown: otherwise
22#
23# Since: 2.1
24##
25{ 'enum': 'NetworkAddressFamily',
26 'data': [ 'ipv4', 'ipv6', 'unix', 'vsock', 'unknown' ] }
27
28##
29# @InetSocketAddressBase:
30#
31# @host: host part of the address
32# @port: port part of the address
33##
34{ 'struct': 'InetSocketAddressBase',
35 'data': {
36 'host': 'str',
37 'port': 'str' } }
38
39##
40# @InetSocketAddress:
41#
a937b6aa
MA
42# Captures a socket address or address range in the Internet
43# namespace.
a2ff5a48 44#
a937b6aa
MA
45# @numeric: true if the host/port are guaranteed to be numeric, false
46# if name resolution should be attempted. Defaults to false.
47# (Since 2.9)
a2ff5a48
MA
48#
49# @to: If present, this is range of possible addresses, with port
a937b6aa 50# between @port and @to.
a2ff5a48 51#
a937b6aa
MA
52# @ipv4: whether to accept IPv4 addresses, default try both IPv4 and
53# IPv6
a2ff5a48 54#
a937b6aa
MA
55# @ipv6: whether to accept IPv6 addresses, default try both IPv4 and
56# IPv6
a2ff5a48 57#
a937b6aa
MA
58# @keep-alive: enable keep-alive when connecting to this socket. Not
59# supported for passive sockets. (Since 4.2)
aec21d31 60#
5305a4ee 61# @mptcp: enable multi-path TCP. (Since 6.1)
8bd1078a 62#
a2ff5a48
MA
63# Since: 1.3
64##
65{ 'struct': 'InetSocketAddress',
66 'base': 'InetSocketAddressBase',
67 'data': {
68 '*numeric': 'bool',
69 '*to': 'uint16',
70 '*ipv4': 'bool',
aec21d31 71 '*ipv6': 'bool',
8bd1078a 72 '*keep-alive': 'bool',
653163fc 73 '*mptcp': { 'type': 'bool', 'if': 'HAVE_IPPROTO_MPTCP' } } }
a2ff5a48
MA
74
75##
76# @UnixSocketAddress:
77#
78# Captures a socket address in the local ("Unix socket") namespace.
79#
80# @path: filesystem path to use
a937b6aa 81#
8acefc79 82# @abstract: if true, this is a Linux abstract socket address. @path
a937b6aa
MA
83# will be prefixed by a null byte, and optionally padded with null
84# bytes. Defaults to false. (Since 5.1)
85#
8acefc79 86# @tight: if false, pad an abstract socket address with enough null
a937b6aa
MA
87# bytes to make it fill struct sockaddr_un member sun_path.
88# Defaults to true. (Since 5.1)
a2ff5a48
MA
89#
90# Since: 1.3
91##
92{ 'struct': 'UnixSocketAddress',
93 'data': {
776b97d3 94 'path': 'str',
8a9f1e1d
MAL
95 '*abstract': { 'type': 'bool', 'if': 'CONFIG_LINUX' },
96 '*tight': { 'type': 'bool', 'if': 'CONFIG_LINUX' } } }
a2ff5a48
MA
97
98##
99# @VsockSocketAddress:
100#
101# Captures a socket address in the vsock namespace.
102#
103# @cid: unique host identifier
a937b6aa 104#
a2ff5a48
MA
105# @port: port
106#
107# Note: string types are used to allow for possible future hostname or
a937b6aa 108# service resolution support.
a2ff5a48
MA
109#
110# Since: 2.8
111##
112{ 'struct': 'VsockSocketAddress',
113 'data': {
114 'cid': 'str',
115 'port': 'str' } }
116
4edb196e
MA
117##
118# @FdSocketAddress:
119#
120# A file descriptor name or number.
121#
122# @str: decimal is for file descriptor number, otherwise it's a file
123# descriptor name. Named file descriptors are permitted in
124# monitor commands, in combination with the 'getfd' command.
125# Decimal file descriptors are permitted at startup or other
126# contexts where no monitor context is active.
127#
4edb196e
MA
128# Since: 1.2
129##
130{ 'struct': 'FdSocketAddress',
131 'data': {
132 'str': 'str' } }
133
935a867c
MA
134##
135# @InetSocketAddressWrapper:
136#
2fecccbc
MA
137# @data: internet domain socket address
138#
935a867c
MA
139# Since: 1.3
140##
141{ 'struct': 'InetSocketAddressWrapper',
142 'data': { 'data': 'InetSocketAddress' } }
143
144##
145# @UnixSocketAddressWrapper:
146#
2fecccbc
MA
147# @data: UNIX domain socket address
148#
935a867c
MA
149# Since: 1.3
150##
151{ 'struct': 'UnixSocketAddressWrapper',
152 'data': { 'data': 'UnixSocketAddress' } }
153
154##
155# @VsockSocketAddressWrapper:
156#
2fecccbc
MA
157# @data: VSOCK domain socket address
158#
935a867c
MA
159# Since: 2.8
160##
161{ 'struct': 'VsockSocketAddressWrapper',
162 'data': { 'data': 'VsockSocketAddress' } }
163
164##
4edb196e
MA
165# @FdSocketAddressWrapper:
166#
167# @data: file descriptor name or number
935a867c
MA
168#
169# Since: 1.3
170##
4edb196e
MA
171{ 'struct': 'FdSocketAddressWrapper',
172 'data': { 'data': 'FdSocketAddress' } }
935a867c 173
a2ff5a48
MA
174##
175# @SocketAddressLegacy:
176#
a937b6aa
MA
177# Captures the address of a socket, which could also be a named file
178# descriptor
a2ff5a48 179#
89a2273b
MA
180# @type: Transport type
181#
a2ff5a48 182# Note: This type is deprecated in favor of SocketAddress. The
a937b6aa
MA
183# difference between SocketAddressLegacy and SocketAddress is that
184# the latter has fewer {} on the wire.
a2ff5a48
MA
185#
186# Since: 1.3
187##
188{ 'union': 'SocketAddressLegacy',
935a867c
MA
189 'base': { 'type': 'SocketAddressType' },
190 'discriminator': 'type',
a2ff5a48 191 'data': {
935a867c
MA
192 'inet': 'InetSocketAddressWrapper',
193 'unix': 'UnixSocketAddressWrapper',
194 'vsock': 'VsockSocketAddressWrapper',
4edb196e 195 'fd': 'FdSocketAddressWrapper' } }
a2ff5a48
MA
196
197##
198# @SocketAddressType:
199#
200# Available SocketAddress types
201#
c0ac533b 202# @inet: Internet address
a2ff5a48 203#
c0ac533b 204# @unix: Unix domain socket
a2ff5a48 205#
1723d6b1
DB
206# @vsock: VMCI address
207#
4edb196e 208# @fd: Socket file descriptor
1723d6b1 209#
a2ff5a48
MA
210# Since: 2.9
211##
212{ 'enum': 'SocketAddressType',
213 'data': [ 'inet', 'unix', 'vsock', 'fd' ] }
214
215##
216# @SocketAddress:
217#
4edb196e 218# Captures the address of a socket, which could also be a socket file
a2ff5a48
MA
219# descriptor
220#
23e46452 221# @type: Transport type
a2ff5a48
MA
222#
223# Since: 2.9
224##
225{ 'union': 'SocketAddress',
226 'base': { 'type': 'SocketAddressType' },
227 'discriminator': 'type',
228 'data': { 'inet': 'InetSocketAddress',
229 'unix': 'UnixSocketAddress',
230 'vsock': 'VsockSocketAddress',
4edb196e 231 'fd': 'FdSocketAddress' } }