1# -*- 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# 56# Since: 1.3 57## 58{ 'struct': 'InetSocketAddress', 59 'base': 'InetSocketAddressBase', 60 'data': { 61 '*numeric': 'bool', 62 '*to': 'uint16', 63 '*ipv4': 'bool', 64 '*ipv6': 'bool' } } 65 66## 67# @UnixSocketAddress: 68# 69# Captures a socket address in the local ("Unix socket") namespace. 70# 71# @path: filesystem path to use 72# 73# Since: 1.3 74## 75{ 'struct': 'UnixSocketAddress', 76 'data': { 77 'path': 'str' } } 78 79## 80# @VsockSocketAddress: 81# 82# Captures a socket address in the vsock namespace. 83# 84# @cid: unique host identifier 85# @port: port 86# 87# Note: string types are used to allow for possible future hostname or 88# service resolution support. 89# 90# Since: 2.8 91## 92{ 'struct': 'VsockSocketAddress', 93 'data': { 94 'cid': 'str', 95 'port': 'str' } } 96 97## 98# @SocketAddressLegacy: 99# 100# Captures the address of a socket, which could also be a named file descriptor 101# 102# Note: This type is deprecated in favor of SocketAddress. The 103# difference between SocketAddressLegacy and SocketAddress is that the 104# latter is a flat union rather than a simple union. Flat is nicer 105# because it avoids nesting on the wire, i.e. that form has fewer {}. 106 107# 108# Since: 1.3 109## 110{ 'union': 'SocketAddressLegacy', 111 'data': { 112 'inet': 'InetSocketAddress', 113 'unix': 'UnixSocketAddress', 114 'vsock': 'VsockSocketAddress', 115 'fd': 'String' } } 116 117## 118# @SocketAddressType: 119# 120# Available SocketAddress types 121# 122# @inet: Internet address 123# 124# @unix: Unix domain socket 125# 126# Since: 2.9 127## 128{ 'enum': 'SocketAddressType', 129 'data': [ 'inet', 'unix', 'vsock', 'fd' ] } 130 131## 132# @SocketAddress: 133# 134# Captures the address of a socket, which could also be a named file 135# descriptor 136# 137# @type: Transport type 138# 139# Since: 2.9 140## 141{ 'union': 'SocketAddress', 142 'base': { 'type': 'SocketAddressType' }, 143 'discriminator': 'type', 144 'data': { 'inet': 'InetSocketAddress', 145 'unix': 'UnixSocketAddress', 146 'vsock': 'VsockSocketAddress', 147 'fd': 'String' } } 148