sockets.json 4.9 KB

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