target/mips: Simplify decode_opc_mxu() ifdef'ry
[qemu/ar7.git] / qapi / sockets.json
blob2e83452797f81f30dee300f58241b3a15f9120ca
1 # -*- Mode: Python -*-
2 # vim: filetype=python
4 ##
5 # = Socket data types
6 ##
8 { 'include': 'common.json' }
11 # @NetworkAddressFamily:
13 # The network address family
15 # @ipv4: IPV4 family
17 # @ipv6: IPV6 family
19 # @unix: unix socket
21 # @vsock: vsock family (since 2.8)
23 # @unknown: otherwise
25 # Since: 2.1
27 { 'enum': 'NetworkAddressFamily',
28   'data': [ 'ipv4', 'ipv6', 'unix', 'vsock', 'unknown' ] }
31 # @InetSocketAddressBase:
33 # @host: host part of the address
34 # @port: port part of the address
36 { 'struct': 'InetSocketAddressBase',
37   'data': {
38     'host': 'str',
39     'port': 'str' } }
42 # @InetSocketAddress:
44 # Captures a socket address or address range in the Internet namespace.
46 # @numeric: true if the host/port are guaranteed to be numeric,
47 #           false if name resolution should be attempted. Defaults to false.
48 #           (Since 2.9)
50 # @to: If present, this is range of possible addresses, with port
51 #      between @port and @to.
53 # @ipv4: whether to accept IPv4 addresses, default try both IPv4 and IPv6
55 # @ipv6: whether to accept IPv6 addresses, default try both IPv4 and IPv6
57 # @keep-alive: enable keep-alive when connecting to this socket. Not supported
58 #              for passive sockets. (Since 4.2)
60 # Since: 1.3
62 { 'struct': 'InetSocketAddress',
63   'base': 'InetSocketAddressBase',
64   'data': {
65     '*numeric':  'bool',
66     '*to': 'uint16',
67     '*ipv4': 'bool',
68     '*ipv6': 'bool',
69     '*keep-alive': 'bool' } }
72 # @UnixSocketAddress:
74 # Captures a socket address in the local ("Unix socket") namespace.
76 # @path: filesystem path to use
77 # @abstract: if true, this is a Linux abstract socket address.  @path
78 #            will be prefixed by a null byte, and optionally padded
79 #            with null bytes.  Defaults to false.  (Since 5.1)
80 # @tight: if false, pad an abstract socket address with enough null
81 #         bytes to make it fill struct sockaddr_un member sun_path.
82 #         Defaults to true.  (Since 5.1)
84 # Since: 1.3
86 { 'struct': 'UnixSocketAddress',
87   'data': {
88     'path': 'str',
89     '*abstract': { 'type': 'bool', 'if': 'defined(CONFIG_LINUX)' },
90     '*tight': { 'type': 'bool', 'if': 'defined(CONFIG_LINUX)' } } }
93 # @VsockSocketAddress:
95 # Captures a socket address in the vsock namespace.
97 # @cid: unique host identifier
98 # @port: port
100 # Note: string types are used to allow for possible future hostname or
101 #       service resolution support.
103 # Since: 2.8
105 { 'struct': 'VsockSocketAddress',
106   'data': {
107     'cid': 'str',
108     'port': 'str' } }
111 # @SocketAddressLegacy:
113 # Captures the address of a socket, which could also be a named file descriptor
115 # Note: This type is deprecated in favor of SocketAddress.  The
116 #       difference between SocketAddressLegacy and SocketAddress is that the
117 #       latter is a flat union rather than a simple union. Flat is nicer
118 #       because it avoids nesting on the wire, i.e. that form has fewer {}.
121 # Since: 1.3
123 { 'union': 'SocketAddressLegacy',
124   'data': {
125     'inet': 'InetSocketAddress',
126     'unix': 'UnixSocketAddress',
127     'vsock': 'VsockSocketAddress',
128     'fd': 'String' } }
131 # @SocketAddressType:
133 # Available SocketAddress types
135 # @inet:  Internet address
137 # @unix:  Unix domain socket
139 # @vsock: VMCI address
141 # @fd: decimal is for file descriptor number, otherwise a file descriptor name.
142 #      Named file descriptors are permitted in monitor commands, in combination
143 #      with the 'getfd' command. Decimal file descriptors are permitted at
144 #      startup or other contexts where no monitor context is active.
146 # Since: 2.9
148 { 'enum': 'SocketAddressType',
149   'data': [ 'inet', 'unix', 'vsock', 'fd' ] }
152 # @SocketAddress:
154 # Captures the address of a socket, which could also be a named file
155 # descriptor
157 # @type:       Transport type
159 # Since: 2.9
161 { 'union': 'SocketAddress',
162   'base': { 'type': 'SocketAddressType' },
163   'discriminator': 'type',
164   'data': { 'inet': 'InetSocketAddress',
165             'unix': 'UnixSocketAddress',
166             'vsock': 'VsockSocketAddress',
167             'fd': 'String' } }