blob: cbd6ef35d0afad6fa5f67c0a955571a1b0787853 [file] [log] [blame]
Markus Armbrustera2ff5a42017-08-24 21:13:56 +02001# -*- Mode: Python -*-
2
3##
4# = Socket data types
5##
6
7{ 'include': 'common.json' }
8
9##
10# @NetworkAddressFamily:
11#
12# The network address family
13#
14# @ipv4: IPV4 family
15#
16# @ipv6: IPV6 family
17#
18# @unix: unix socket
19#
20# @vsock: vsock family (since 2.8)
21#
22# @unknown: otherwise
23#
24# Since: 2.1
25##
26{ 'enum': 'NetworkAddressFamily',
27 'data': [ 'ipv4', 'ipv6', 'unix', 'vsock', 'unknown' ] }
28
29##
30# @InetSocketAddressBase:
31#
32# @host: host part of the address
33# @port: port part of the address
34##
35{ 'struct': 'InetSocketAddressBase',
36 'data': {
37 'host': 'str',
38 'port': 'str' } }
39
40##
41# @InetSocketAddress:
42#
43# Captures a socket address or address range in the Internet namespace.
44#
45# @numeric: true if the host/port are guaranteed to be numeric,
46# false if name resolution should be attempted. Defaults to false.
47# (Since 2.9)
48#
49# @to: If present, this is range of possible addresses, with port
50# between @port and @to.
51#
52# @ipv4: whether to accept IPv4 addresses, default try both IPv4 and IPv6
53#
54# @ipv6: whether to accept IPv6 addresses, default try both IPv4 and IPv6
55#
Vladimir Sementsov-Ogievskiyaec21d32019-07-25 12:49:37 +030056# @keep-alive: enable keep-alive when connecting to this socket. Not supported
57# for passive sockets. (Since 4.2)
58#
Markus Armbrustera2ff5a42017-08-24 21:13:56 +020059# Since: 1.3
60##
61{ 'struct': 'InetSocketAddress',
62 'base': 'InetSocketAddressBase',
63 'data': {
64 '*numeric': 'bool',
65 '*to': 'uint16',
66 '*ipv4': 'bool',
Vladimir Sementsov-Ogievskiyaec21d32019-07-25 12:49:37 +030067 '*ipv6': 'bool',
68 '*keep-alive': 'bool' } }
Markus Armbrustera2ff5a42017-08-24 21:13:56 +020069
70##
71# @UnixSocketAddress:
72#
73# Captures a socket address in the local ("Unix socket") namespace.
74#
75# @path: filesystem path to use
xiaoqiang zhao776b97d2020-05-16 11:13:25 +080076# @tight: pass a socket address length confined to the minimum length of the
77# abstract string, rather than the full sockaddr_un record length
78# (only matters for abstract sockets, default true). (Since 5.1)
79# @abstract: whether this is an abstract address, default false. (Since 5.1)
Markus Armbrustera2ff5a42017-08-24 21:13:56 +020080#
81# Since: 1.3
82##
83{ 'struct': 'UnixSocketAddress',
84 'data': {
xiaoqiang zhao776b97d2020-05-16 11:13:25 +080085 'path': 'str',
86 '*tight': 'bool',
87 '*abstract': 'bool' } }
Markus Armbrustera2ff5a42017-08-24 21:13:56 +020088
89##
90# @VsockSocketAddress:
91#
92# Captures a socket address in the vsock namespace.
93#
94# @cid: unique host identifier
95# @port: port
96#
97# Note: string types are used to allow for possible future hostname or
Peter Maydell26ec4e52020-02-13 17:56:26 +000098# service resolution support.
Markus Armbrustera2ff5a42017-08-24 21:13:56 +020099#
100# Since: 2.8
101##
102{ 'struct': 'VsockSocketAddress',
103 'data': {
104 'cid': 'str',
105 'port': 'str' } }
106
107##
108# @SocketAddressLegacy:
109#
110# Captures the address of a socket, which could also be a named file descriptor
111#
112# Note: This type is deprecated in favor of SocketAddress. The
Peter Maydell26ec4e52020-02-13 17:56:26 +0000113# difference between SocketAddressLegacy and SocketAddress is that the
114# latter is a flat union rather than a simple union. Flat is nicer
115# because it avoids nesting on the wire, i.e. that form has fewer {}.
Markus Armbrustera2ff5a42017-08-24 21:13:56 +0200116
117#
118# Since: 1.3
119##
120{ 'union': 'SocketAddressLegacy',
121 'data': {
122 'inet': 'InetSocketAddress',
123 'unix': 'UnixSocketAddress',
124 'vsock': 'VsockSocketAddress',
125 'fd': 'String' } }
126
127##
128# @SocketAddressType:
129#
130# Available SocketAddress types
131#
132# @inet: Internet address
133#
134# @unix: Unix domain socket
135#
Daniel P. Berrange1723d6b2017-12-22 11:04:30 +0000136# @vsock: VMCI address
137#
138# @fd: decimal is for file descriptor number, otherwise a file descriptor name.
139# Named file descriptors are permitted in monitor commands, in combination
140# with the 'getfd' command. Decimal file descriptors are permitted at
141# startup or other contexts where no monitor context is active.
142#
Markus Armbrustera2ff5a42017-08-24 21:13:56 +0200143# Since: 2.9
144##
145{ 'enum': 'SocketAddressType',
146 'data': [ 'inet', 'unix', 'vsock', 'fd' ] }
147
148##
149# @SocketAddress:
150#
151# Captures the address of a socket, which could also be a named file
152# descriptor
153#
154# @type: Transport type
155#
156# Since: 2.9
157##
158{ 'union': 'SocketAddress',
159 'base': { 'type': 'SocketAddressType' },
160 'discriminator': 'type',
161 'data': { 'inet': 'InetSocketAddress',
162 'unix': 'UnixSocketAddress',
163 'vsock': 'VsockSocketAddress',
164 'fd': 'String' } }