Markus Armbruster | a2ff5a4 | 2017-08-24 21:13:56 +0200 | [diff] [blame] | 1 | # -*- Mode: Python -*- |
Andrea Bolognani | f7160f3 | 2020-07-29 20:50:24 +0200 | [diff] [blame] | 2 | # vim: filetype=python |
Markus Armbruster | a2ff5a4 | 2017-08-24 21:13:56 +0200 | [diff] [blame] | 3 | |
| 4 | ## |
| 5 | # = Socket data types |
| 6 | ## |
| 7 | |
| 8 | { 'include': 'common.json' } |
| 9 | |
| 10 | ## |
| 11 | # @NetworkAddressFamily: |
| 12 | # |
| 13 | # The network address family |
| 14 | # |
| 15 | # @ipv4: IPV4 family |
| 16 | # |
| 17 | # @ipv6: IPV6 family |
| 18 | # |
| 19 | # @unix: unix socket |
| 20 | # |
| 21 | # @vsock: vsock family (since 2.8) |
| 22 | # |
| 23 | # @unknown: otherwise |
| 24 | # |
| 25 | # Since: 2.1 |
| 26 | ## |
| 27 | { 'enum': 'NetworkAddressFamily', |
| 28 | 'data': [ 'ipv4', 'ipv6', 'unix', 'vsock', 'unknown' ] } |
| 29 | |
| 30 | ## |
| 31 | # @InetSocketAddressBase: |
| 32 | # |
| 33 | # @host: host part of the address |
| 34 | # @port: port part of the address |
| 35 | ## |
| 36 | { 'struct': 'InetSocketAddressBase', |
| 37 | 'data': { |
| 38 | 'host': 'str', |
| 39 | 'port': 'str' } } |
| 40 | |
| 41 | ## |
| 42 | # @InetSocketAddress: |
| 43 | # |
Markus Armbruster | a937b6a | 2023-04-28 12:54:29 +0200 | [diff] [blame] | 44 | # Captures a socket address or address range in the Internet |
| 45 | # namespace. |
Markus Armbruster | a2ff5a4 | 2017-08-24 21:13:56 +0200 | [diff] [blame] | 46 | # |
Markus Armbruster | a937b6a | 2023-04-28 12:54:29 +0200 | [diff] [blame] | 47 | # @numeric: true if the host/port are guaranteed to be numeric, false |
| 48 | # if name resolution should be attempted. Defaults to false. |
| 49 | # (Since 2.9) |
Markus Armbruster | a2ff5a4 | 2017-08-24 21:13:56 +0200 | [diff] [blame] | 50 | # |
| 51 | # @to: If present, this is range of possible addresses, with port |
Markus Armbruster | a937b6a | 2023-04-28 12:54:29 +0200 | [diff] [blame] | 52 | # between @port and @to. |
Markus Armbruster | a2ff5a4 | 2017-08-24 21:13:56 +0200 | [diff] [blame] | 53 | # |
Markus Armbruster | a937b6a | 2023-04-28 12:54:29 +0200 | [diff] [blame] | 54 | # @ipv4: whether to accept IPv4 addresses, default try both IPv4 and |
| 55 | # IPv6 |
Markus Armbruster | a2ff5a4 | 2017-08-24 21:13:56 +0200 | [diff] [blame] | 56 | # |
Markus Armbruster | a937b6a | 2023-04-28 12:54:29 +0200 | [diff] [blame] | 57 | # @ipv6: whether to accept IPv6 addresses, default try both IPv4 and |
| 58 | # IPv6 |
Markus Armbruster | a2ff5a4 | 2017-08-24 21:13:56 +0200 | [diff] [blame] | 59 | # |
Markus Armbruster | a937b6a | 2023-04-28 12:54:29 +0200 | [diff] [blame] | 60 | # @keep-alive: enable keep-alive when connecting to this socket. Not |
| 61 | # supported for passive sockets. (Since 4.2) |
Vladimir Sementsov-Ogievskiy | aec21d3 | 2019-07-25 12:49:37 +0300 | [diff] [blame] | 62 | # |
Dr. David Alan Gilbert | 8bd1078 | 2021-04-21 12:28:34 +0100 | [diff] [blame] | 63 | # @mptcp: enable multi-path TCP. (Since 6.1) |
| 64 | # |
Markus Armbruster | a2ff5a4 | 2017-08-24 21:13:56 +0200 | [diff] [blame] | 65 | # Since: 1.3 |
| 66 | ## |
| 67 | { 'struct': 'InetSocketAddress', |
| 68 | 'base': 'InetSocketAddressBase', |
| 69 | 'data': { |
| 70 | '*numeric': 'bool', |
| 71 | '*to': 'uint16', |
| 72 | '*ipv4': 'bool', |
Vladimir Sementsov-Ogievskiy | aec21d3 | 2019-07-25 12:49:37 +0300 | [diff] [blame] | 73 | '*ipv6': 'bool', |
Dr. David Alan Gilbert | 8bd1078 | 2021-04-21 12:28:34 +0100 | [diff] [blame] | 74 | '*keep-alive': 'bool', |
Marc-André Lureau | 653163f | 2021-09-07 16:19:13 +0400 | [diff] [blame] | 75 | '*mptcp': { 'type': 'bool', 'if': 'HAVE_IPPROTO_MPTCP' } } } |
Markus Armbruster | a2ff5a4 | 2017-08-24 21:13:56 +0200 | [diff] [blame] | 76 | |
| 77 | ## |
| 78 | # @UnixSocketAddress: |
| 79 | # |
| 80 | # Captures a socket address in the local ("Unix socket") namespace. |
| 81 | # |
| 82 | # @path: filesystem path to use |
Markus Armbruster | a937b6a | 2023-04-28 12:54:29 +0200 | [diff] [blame] | 83 | # |
Markus Armbruster | 8acefc7 | 2020-11-02 10:44:22 +0100 | [diff] [blame] | 84 | # @abstract: if true, this is a Linux abstract socket address. @path |
Markus Armbruster | a937b6a | 2023-04-28 12:54:29 +0200 | [diff] [blame] | 85 | # will be prefixed by a null byte, and optionally padded with null |
| 86 | # bytes. Defaults to false. (Since 5.1) |
| 87 | # |
Markus Armbruster | 8acefc7 | 2020-11-02 10:44:22 +0100 | [diff] [blame] | 88 | # @tight: if false, pad an abstract socket address with enough null |
Markus Armbruster | a937b6a | 2023-04-28 12:54:29 +0200 | [diff] [blame] | 89 | # bytes to make it fill struct sockaddr_un member sun_path. |
| 90 | # Defaults to true. (Since 5.1) |
Markus Armbruster | a2ff5a4 | 2017-08-24 21:13:56 +0200 | [diff] [blame] | 91 | # |
| 92 | # Since: 1.3 |
| 93 | ## |
| 94 | { 'struct': 'UnixSocketAddress', |
| 95 | 'data': { |
xiaoqiang zhao | 776b97d | 2020-05-16 11:13:25 +0800 | [diff] [blame] | 96 | 'path': 'str', |
Marc-André Lureau | 8a9f1e1 | 2021-08-04 12:31:05 +0400 | [diff] [blame] | 97 | '*abstract': { 'type': 'bool', 'if': 'CONFIG_LINUX' }, |
| 98 | '*tight': { 'type': 'bool', 'if': 'CONFIG_LINUX' } } } |
Markus Armbruster | a2ff5a4 | 2017-08-24 21:13:56 +0200 | [diff] [blame] | 99 | |
| 100 | ## |
| 101 | # @VsockSocketAddress: |
| 102 | # |
| 103 | # Captures a socket address in the vsock namespace. |
| 104 | # |
| 105 | # @cid: unique host identifier |
Markus Armbruster | a937b6a | 2023-04-28 12:54:29 +0200 | [diff] [blame] | 106 | # |
Markus Armbruster | a2ff5a4 | 2017-08-24 21:13:56 +0200 | [diff] [blame] | 107 | # @port: port |
| 108 | # |
| 109 | # Note: string types are used to allow for possible future hostname or |
Markus Armbruster | a937b6a | 2023-04-28 12:54:29 +0200 | [diff] [blame] | 110 | # service resolution support. |
Markus Armbruster | a2ff5a4 | 2017-08-24 21:13:56 +0200 | [diff] [blame] | 111 | # |
| 112 | # Since: 2.8 |
| 113 | ## |
| 114 | { 'struct': 'VsockSocketAddress', |
| 115 | 'data': { |
| 116 | 'cid': 'str', |
| 117 | 'port': 'str' } } |
| 118 | |
| 119 | ## |
Markus Armbruster | 935a867 | 2021-09-17 16:31:19 +0200 | [diff] [blame] | 120 | # @InetSocketAddressWrapper: |
| 121 | # |
| 122 | # Since: 1.3 |
| 123 | ## |
| 124 | { 'struct': 'InetSocketAddressWrapper', |
| 125 | 'data': { 'data': 'InetSocketAddress' } } |
| 126 | |
| 127 | ## |
| 128 | # @UnixSocketAddressWrapper: |
| 129 | # |
| 130 | # Since: 1.3 |
| 131 | ## |
| 132 | { 'struct': 'UnixSocketAddressWrapper', |
| 133 | 'data': { 'data': 'UnixSocketAddress' } } |
| 134 | |
| 135 | ## |
| 136 | # @VsockSocketAddressWrapper: |
| 137 | # |
| 138 | # Since: 2.8 |
| 139 | ## |
| 140 | { 'struct': 'VsockSocketAddressWrapper', |
| 141 | 'data': { 'data': 'VsockSocketAddress' } } |
| 142 | |
| 143 | ## |
| 144 | # @StringWrapper: |
| 145 | # |
| 146 | # Since: 1.3 |
| 147 | ## |
| 148 | { 'struct': 'StringWrapper', |
| 149 | 'data': { 'data': 'String' } } |
| 150 | |
| 151 | ## |
Markus Armbruster | a2ff5a4 | 2017-08-24 21:13:56 +0200 | [diff] [blame] | 152 | # @SocketAddressLegacy: |
| 153 | # |
Markus Armbruster | a937b6a | 2023-04-28 12:54:29 +0200 | [diff] [blame] | 154 | # Captures the address of a socket, which could also be a named file |
| 155 | # descriptor |
Markus Armbruster | a2ff5a4 | 2017-08-24 21:13:56 +0200 | [diff] [blame] | 156 | # |
| 157 | # Note: This type is deprecated in favor of SocketAddress. The |
Markus Armbruster | a937b6a | 2023-04-28 12:54:29 +0200 | [diff] [blame] | 158 | # difference between SocketAddressLegacy and SocketAddress is that |
| 159 | # the latter has fewer {} on the wire. |
Markus Armbruster | a2ff5a4 | 2017-08-24 21:13:56 +0200 | [diff] [blame] | 160 | # |
| 161 | # Since: 1.3 |
| 162 | ## |
| 163 | { 'union': 'SocketAddressLegacy', |
Markus Armbruster | 935a867 | 2021-09-17 16:31:19 +0200 | [diff] [blame] | 164 | 'base': { 'type': 'SocketAddressType' }, |
| 165 | 'discriminator': 'type', |
Markus Armbruster | a2ff5a4 | 2017-08-24 21:13:56 +0200 | [diff] [blame] | 166 | 'data': { |
Markus Armbruster | 935a867 | 2021-09-17 16:31:19 +0200 | [diff] [blame] | 167 | 'inet': 'InetSocketAddressWrapper', |
| 168 | 'unix': 'UnixSocketAddressWrapper', |
| 169 | 'vsock': 'VsockSocketAddressWrapper', |
| 170 | 'fd': 'StringWrapper' } } |
Markus Armbruster | a2ff5a4 | 2017-08-24 21:13:56 +0200 | [diff] [blame] | 171 | |
| 172 | ## |
| 173 | # @SocketAddressType: |
| 174 | # |
| 175 | # Available SocketAddress types |
| 176 | # |
Andrea Bolognani | c0ac533 | 2022-05-03 09:37:36 +0200 | [diff] [blame] | 177 | # @inet: Internet address |
Markus Armbruster | a2ff5a4 | 2017-08-24 21:13:56 +0200 | [diff] [blame] | 178 | # |
Andrea Bolognani | c0ac533 | 2022-05-03 09:37:36 +0200 | [diff] [blame] | 179 | # @unix: Unix domain socket |
Markus Armbruster | a2ff5a4 | 2017-08-24 21:13:56 +0200 | [diff] [blame] | 180 | # |
Daniel P. Berrange | 1723d6b | 2017-12-22 11:04:30 +0000 | [diff] [blame] | 181 | # @vsock: VMCI address |
| 182 | # |
Markus Armbruster | a937b6a | 2023-04-28 12:54:29 +0200 | [diff] [blame] | 183 | # @fd: decimal is for file descriptor number, otherwise a file |
| 184 | # descriptor name. Named file descriptors are permitted in |
| 185 | # monitor commands, in combination with the 'getfd' command. |
| 186 | # Decimal file descriptors are permitted at startup or other |
| 187 | # contexts where no monitor context is active. |
Daniel P. Berrange | 1723d6b | 2017-12-22 11:04:30 +0000 | [diff] [blame] | 188 | # |
Markus Armbruster | a2ff5a4 | 2017-08-24 21:13:56 +0200 | [diff] [blame] | 189 | # Since: 2.9 |
| 190 | ## |
| 191 | { 'enum': 'SocketAddressType', |
| 192 | 'data': [ 'inet', 'unix', 'vsock', 'fd' ] } |
| 193 | |
| 194 | ## |
| 195 | # @SocketAddress: |
| 196 | # |
| 197 | # Captures the address of a socket, which could also be a named file |
| 198 | # descriptor |
| 199 | # |
Andrea Bolognani | 23e4645 | 2022-05-03 09:37:35 +0200 | [diff] [blame] | 200 | # @type: Transport type |
Markus Armbruster | a2ff5a4 | 2017-08-24 21:13:56 +0200 | [diff] [blame] | 201 | # |
| 202 | # Since: 2.9 |
| 203 | ## |
| 204 | { 'union': 'SocketAddress', |
| 205 | 'base': { 'type': 'SocketAddressType' }, |
| 206 | 'discriminator': 'type', |
| 207 | 'data': { 'inet': 'InetSocketAddress', |
| 208 | 'unix': 'UnixSocketAddress', |
| 209 | 'vsock': 'VsockSocketAddress', |
| 210 | 'fd': 'String' } } |