diff --git a/abi-versions/vNEXT/README.md b/abi-versions/vNEXT/README.md index df122bc..c13dd3d 100644 --- a/abi-versions/vNEXT/README.md +++ b/abi-versions/vNEXT/README.md @@ -41,13 +41,17 @@ which can be used to distinguish between different contexts. ### Functions exposed by the host -All functions exposed by the host are required. +All functions exposed by the host are optional, unless specified otherwise, +and their availability is gated on advertised [host features]. All Proxy-Wasm functions exposed by the host return [`proxy_status_t`], which indicates status of the call (success, invalid memory access, etc.). Return values are written into memory pointed by `return_` parameters. +Hosts are expected to return `NOT_SUPPORTED` status for functions which are +unimplemented or unavailable due to configuration or policy. + ## Integration @@ -75,6 +79,8 @@ This function is never called. Called when the Wasm module is first loaded. +This function is always supported. + #### `main` @@ -89,6 +95,8 @@ Called when the Wasm module is first loaded. Called when the Wasm module is first loaded, after [`_initialize`]. +This function is always supported. + #### `_start` @@ -102,6 +110,31 @@ Called when the Wasm module is first loaded, after [`_initialize`]. Called when the Wasm module is first loaded. +This function is always supported. + + +### Functions exposed by the host + +#### `proxy_get_host_features` + +* params: + - `i32 (uint8_t **) return_serialized_features_data` + - `i32 (size_t *) return_serialized_features_size` +* returns: + - `i32 (`[`proxy_status_t`]`) status` + +Retrieves a list of key-value pairs containing supported [host features]. + +Returned list (`return_serialized_features_data`, +`return_serialized_features_size`) is [serialized]. + +Returned `status` value is: +- `OK` on success. +- `INVALID_MEMORY_ACCESS` when `return_serialized_features_data` and/or + `return_serialized_features_size` point to invalid memory address. + +This function is always supported. + ## Memory management @@ -122,6 +155,8 @@ memory. Returning `0` indicates failure. +This function is always supported. + ## Context lifecycle @@ -141,6 +176,8 @@ When `parent_context_id` is `0` then a new plugin context is created, otherwise a new per-stream context is created and `parent_context_id` refers to the plugin context. +This function is gated on [`HAS_CORE`] host feature. + #### `proxy_on_done` @@ -157,6 +194,8 @@ Plugin must return one of the following values: and that plugin is going to call [`proxy_done`] later to allow the host to finalize and delete that context. +This function is gated on [`HAS_CORE`] host feature. + #### `proxy_on_log` @@ -173,6 +212,8 @@ This can be used e.g. for generating final log entries. It's called after `true` was returned from [`proxy_on_done`] or after a call to [`proxy_done`]. +This function is gated on [`HAS_CORE`] host feature. + #### `proxy_on_delete` @@ -187,6 +228,8 @@ the plugin should stop tracking it and remove all associated state. It's called after `true` was returned from [`proxy_on_done`] or after a call to [`proxy_done`]. +This function is gated on [`HAS_CORE`] host feature. + ### Functions exposed by the host @@ -207,6 +250,8 @@ Returned `status` value is: - `UNKNOWN_RESOURCE_ID` for unknown `context_id`. - `NOT_FOUND` when active context was not pending finalization. +This function is gated on [`HAS_CORE`] host feature. + ## Configuration @@ -230,6 +275,8 @@ Plugin must return one of the following values: - `false` to indicate that the configuration processing failed, and that this instance of WasmVM shouldn't be used. +This function is gated on [`HAS_CORE`] host feature. + #### `proxy_on_configure` @@ -250,6 +297,8 @@ Plugin must return one of the following values: - `false` to indicate that the configuration processing failed, and that this instance of plugin shouldn't be used. +This function is gated on [`HAS_CORE`] host feature. + ## Logging @@ -272,6 +321,8 @@ Returned `status` value is: - `INVALID_MEMORY_ACCESS` when `message_data` and/or `message_size` point to invalid memory address. +This function is gated on [`HAS_LOGGING`] host feature. + #### `wasi_snapshot_preview1.fd_write` @@ -295,6 +346,8 @@ Returned `errno` value is: - `FAULT` when `iovec`, `iovec_size` and/or `return_written_bytes` point to invalid memory address. +This function is gated on [`HAS_WASI_PREVIEW1_CORE`] host feature. + #### `proxy_get_log_level` @@ -318,6 +371,8 @@ Returned `status` value is: - `INVALID_MEMORY_ACCESS` when `return_log_level` points to invalid memory address. +This function is gated on [`HAS_LOGGING`] host feature. + ## Clocks @@ -346,6 +401,8 @@ Returned `status` value is: - `INVALID_MEMORY_ACCESS` when `return_time` points to invalid memory address. +This function is gated on [`HAS_CORE`] host feature. + #### `wasi_snapshot_preview1.clock_time_get` @@ -368,6 +425,8 @@ Returned `errno` value is: - `NOTSUP` for unknown or unsupported `clock_id`. - `FAULT` when `return_time` points to invalid memory address. +This function is gated on [`HAS_WASI_PREVIEW1_CORE`] host feature. + ## Timers @@ -402,6 +461,8 @@ Returned `status` value is: - `INVALID_MEMORY_ACCESS` when `return_timer_id` points to invalid memory address. +This function is gated on [`HAS_TIMERS`] host feature. + #### `proxy_set_tick_period_milliseconds` @@ -420,6 +481,8 @@ Returned `status` value is: - `OK` on success. - `UNKNOWN_RESOURCE_ID` for unknown `timer_id`. +This function is gated on [`HAS_TIMERS`] host feature. + #### `proxy_delete_timer` @@ -434,6 +497,8 @@ Returned `status` value is: - `OK` on success. - `UNKNOWN_RESOURCE_ID` for unknown `timer_id`. +This function is gated on [`HAS_TIMERS`] host feature. + ### Callbacks exposed by the Wasm module @@ -449,6 +514,8 @@ Called on a timer `timer_id` every tick period. The tick period can be configured using [`proxy_set_tick_period_milliseconds`]. +This function is gated on [`HAS_TIMERS`] host feature. + ## Randomness @@ -470,6 +537,8 @@ Returned `errno` value is: - `FAULT` when `buffer` and/or `buffer_size` point to invalid memory address. +This function is gated on [`HAS_WASI_PREVIEW1_CORE`] host feature. + ## Environment variables @@ -496,6 +565,8 @@ Returned `errno` value is: - `FAULT` when `return_num_elements` and/or `return_buffer_size` point to invalid memory address. +This function is gated on [`HAS_WASI_PREVIEW1_CORE`] host feature. + #### `wasi_snapshot_preview1.environ_get` @@ -512,6 +583,8 @@ Returned `errno` value is: - `FAULT` when `return_array` and/or `return_buffer` point to invalid memory address. +This function is gated on [`HAS_WASI_PREVIEW1_CORE`] host feature. + ## Buffers @@ -570,6 +643,8 @@ Returned `status` value is: - `INVALID_MEMORY_ACCESS` when `value_data` and/or `value_size` point to invalid memory address. +This function is gated on [`HAS_CORE`] host feature. + #### `proxy_get_buffer_bytes` @@ -595,6 +670,8 @@ Returned `status` value is: - `INVALID_MEMORY_ACCESS` when `returned_value_data` and/or `returned_value_size` point to invalid memory address. +This function is gated on [`HAS_CORE`] host feature. + #### `proxy_get_buffer_status` @@ -617,6 +694,8 @@ Returned `status` value is: - `INVALID_MEMORY_ACCESS` when `return_buffer_size` and/or `return_unused` point to invalid memory address. +This function is gated on [`HAS_CORE`] host feature. + ## HTTP fields @@ -670,6 +749,11 @@ Returned `status` value is: - `INVALID_MEMORY_ACCESS` when `return_serialized_pairs_size` points to invalid memory address. +This function is available if any of the following features is enabled: +[`HAS_HTTP_HEADERS`], [`HAS_HTTP_WITH_BODY`], [`HAS_HTTP_CALLOUTS_BUFFERED`], +[`HAS_HTTP_CALLOUTS_STREAMING`], [`HAS_GRPC_CALLOUTS_BUFFERED`] +or [`HAS_GRPC_CALLOUTS_STREAMING`]. + #### `proxy_get_header_map_pairs` @@ -694,6 +778,11 @@ Returned `status` value is: - `INVALID_MEMORY_ACCESS` when `return_serialized_pairs_data` and/or `return_serialized_pairs_size` point to invalid memory address. +This function is available if any of the following features is enabled: +[`HAS_HTTP_HEADERS`], [`HAS_HTTP_WITH_BODY`], [`HAS_HTTP_CALLOUTS_BUFFERED`], +[`HAS_HTTP_CALLOUTS_STREAMING`], [`HAS_GRPC_CALLOUTS_BUFFERED`] +or [`HAS_GRPC_CALLOUTS_STREAMING`]. + #### `proxy_set_header_map_pairs` @@ -716,6 +805,9 @@ Returned `status` value is: - `INVALID_MEMORY_ACCESS` when `serialized_pairs_data` and/or `serialized_pairs_size` point to invalid memory address. +This function is available if any of the following features is enabled: +[`HAS_HTTP_HEADERS`] or [`HAS_HTTP_WITH_BODY`]. + #### `proxy_get_header_map_value` @@ -742,6 +834,11 @@ Returned `status` value is: `return_value_data` and/or `return_value_size` point to invalid memory address. +This function is available if any of the following features is enabled: +[`HAS_HTTP_HEADERS`], [`HAS_HTTP_WITH_BODY`], [`HAS_HTTP_CALLOUTS_BUFFERED`], +[`HAS_HTTP_CALLOUTS_STREAMING`], [`HAS_GRPC_CALLOUTS_BUFFERED`] +or [`HAS_GRPC_CALLOUTS_STREAMING`]. + #### `proxy_add_header_map_value` @@ -765,6 +862,9 @@ Returned `status` value is: - `INVALID_MEMORY_ACCESS` when `key_data`, `key_size`, `value_data` and/or `value_size` point to invalid memory address. +This function is available if any of the following features is enabled: +[`HAS_HTTP_HEADERS`] or [`HAS_HTTP_WITH_BODY`]. + #### `proxy_set_header_map_value` @@ -792,6 +892,9 @@ Returned `status` value is: - `INVALID_MEMORY_ACCESS` when `key_data`, `key_size`, `value_data` and/or `value_size` point to invalid memory address. +This function is available if any of the following features is enabled: +[`HAS_HTTP_HEADERS`] or [`HAS_HTTP_WITH_BODY`]. + ## Common HTTP and TCP stream operations @@ -811,9 +914,13 @@ Returned `status` value is: - `OK` on success. - `UNKNOWN_RESOURCE_ID` for unknown `stream_context_id`. - `BAD_ARGUMENT` for unknown `stream_type`. -- `UNIMPLEMENTED` when continuation of the requested `stream_type` +- `NOT_SUPPORTED` when continuation of the requested `stream_type` is not supported. +This function is available if any of the following features is enabled: +[`HAS_HTTP_HEADERS`], [`HAS_HTTP_WITH_BODY`], [`HAS_TCP_FILTER`] +or [`HAS_TCP_WITH_PAYLOAD`]. + #### `proxy_close_stream` @@ -830,6 +937,10 @@ Returned `status` value is: - `UNKNOWN_RESOURCE_ID` for unknown `stream_context_id`. - `BAD_ARGUMENT` for unknown `stream_type`. +This function is available if any of the following features is enabled: +[`HAS_HTTP_HEADERS`], [`HAS_HTTP_WITH_BODY`], [`HAS_TCP_FILTER`] +or [`HAS_TCP_WITH_PAYLOAD`]. + #### `proxy_get_status` @@ -854,6 +965,10 @@ Returned `status` value is: `return_status_message_data` and/or `return_status_message_size` point to invalid memory address. +This function is available if any of the following features is enabled: +[`HAS_HTTP_CALLOUTS_BUFFERED`], [`HAS_HTTP_CALLOUTS_STREAMING`], +[`HAS_GRPC_CALLOUTS_BUFFERED`] or [`HAS_GRPC_CALLOUTS_STREAMING`]. + ## TCP streams @@ -882,6 +997,9 @@ Plugin must return one of the following values: - `CONTINUE` to allow the new connection to be established. - `PAUSE` to pause processing of the new connection. +This function is available if any of the following features is enabled: +[`HAS_TCP_FILTER`] or [`HAS_TCP_WITH_PAYLOAD`]. + #### `proxy_on_downstream_data` @@ -911,6 +1029,8 @@ Plugin must return one of the following values: - `CONTINUE` to forward `DOWNSTREAM_DATA` buffer upstream. - `PAUSE` to pause processing. +This function is gated on [`HAS_TCP_WITH_PAYLOAD`] host feature. + #### `proxy_on_downstream_connection_close` @@ -925,6 +1045,8 @@ Called when downstream connection is closed. The `peer_type` should describe whether this was initiated by a `LOCAL` or `REMOTE` peer, but this value might also be `UNKNOWN`. +This function is gated on [`HAS_TCP_WITH_PAYLOAD`] host feature. + #### `proxy_on_upstream_data` @@ -954,6 +1076,8 @@ Plugin must return one of the following values: - `CONTINUE` to forward `UPSTREAM_DATA` buffer downstream. - `PAUSE` to pause processing. +This function is gated on [`HAS_TCP_WITH_PAYLOAD`] host feature. + #### `proxy_on_upstream_connection_close` @@ -968,6 +1092,8 @@ Called when upstream connection is closed. The `peer_type` should describe whether this was initiated by a `LOCAL` or `REMOTE` peer, but this value might also be `UNKNOWN`. +This function is gated on [`HAS_TCP_WITH_PAYLOAD`] host feature. + ## HTTP streams @@ -1007,6 +1133,9 @@ Plugin must return one of the following values: - `CONTINUE` to forward `HTTP_REQUEST_HEADERS` fields downstream. - `PAUSE` to pause processing. +This function is available if any of the following features is enabled: +[`HAS_HTTP_HEADERS`] or [`HAS_HTTP_WITH_BODY`]. + #### `proxy_on_request_body` @@ -1039,6 +1168,8 @@ Plugin must return one of the following values: - `CONTINUE` to forward `HTTP_REQUEST_BODY` buffer upstream. - `PAUSE` to pause processing. +This function is gated on [`HAS_HTTP_WITH_BODY`] host feature. + #### `proxy_on_request_trailers` @@ -1068,6 +1199,8 @@ Plugin must return one of the following values: - `CONTINUE` to forward `HTTP_REQUEST_TRAILERS` fields downstream. - `PAUSE` to pause processing. +This function is gated on [`HAS_HTTP_WITH_BODY`] host feature. + #### `proxy_on_response_headers` @@ -1101,6 +1234,9 @@ Plugin must return one of the following values: - `CONTINUE` to forward `HTTP_RESPONSE_HEADERS` fields downstream. - `PAUSE` to pause processing. +This function is available if any of the following features is enabled: +[`HAS_HTTP_HEADERS`] or [`HAS_HTTP_WITH_BODY`]. + #### `proxy_on_response_body` @@ -1130,6 +1266,8 @@ Plugin must return one of the following values: - `CONTINUE` to forward `HTTP_RESPONSE_BODY` buffer downstream. - `PAUSE` to pause processing. +This function is gated on [`HAS_HTTP_WITH_BODY`] host feature. + #### `proxy_on_response_trailers` @@ -1156,6 +1294,8 @@ Plugin must return one of the following values: - `CONTINUE` to forward `HTTP_RESPONSE_TRAILERS` fields downstream. - `PAUSE` to pause processing. +This function is gated on [`HAS_HTTP_WITH_BODY`] host feature. + ### Functions exposed by the host @@ -1188,6 +1328,9 @@ Returned `status` value is: `serialized_headers_data` and/or `serialized_headers_size` point to invalid memory address. +This function is available if any of the following features is enabled: +[`HAS_HTTP_HEADERS`] or [`HAS_HTTP_WITH_BODY`]. + ## HTTP calls @@ -1231,6 +1374,8 @@ Returned `status` value is: `body_size`, `serialized_trailers_data`, `serialized_trailers_size` and/or `return_call_id` point to invalid memory address. +This function is gated on [`HAS_HTTP_CALLOUTS_BUFFERED`] host feature. + ### Callbacks exposed by the Wasm module @@ -1267,6 +1412,8 @@ All HTTP response trailers can be retrieved using The presence of trailers is indicated by `has_trailers=1`. +This function is gated on [`HAS_HTTP_CALLOUTS_BUFFERED`] host feature. + ## gRPC calls @@ -1318,6 +1465,8 @@ Returned `status` value is: `serialized_initial_metadata_size`, `message_data`, `message_size` and/or `return_call_id` point to invalid memory address. +This function is gated on [`HAS_GRPC_CALLOUTS_BUFFERED`] host feature. + #### `proxy_grpc_stream` @@ -1365,6 +1514,8 @@ Returned `status` value is: `serialized_initial_metadata_size` and/or `return_stream_id` point to invalid memory address. +This function is gated on [`HAS_GRPC_CALLOUTS_STREAMING`] host feature. + #### `proxy_grpc_send` @@ -1386,6 +1537,8 @@ Returned `status` value is: - `INVALID_MEMORY_ACCESS` when `message_data` and/or `message_size` point to invalid memory address. +This function is gated on [`HAS_GRPC_CALLOUTS_STREAMING`] host feature. + #### `proxy_grpc_cancel` @@ -1402,6 +1555,9 @@ Returned `status` value is: - `BAD_ARGUMENT` for invalid `call_or_stream_id`. - `UNKNOWN_RESOURCE_ID` for unknown `call_or_stream_id`. +This function is available if any of the following features is enabled: +[`HAS_GRPC_CALLOUTS_BUFFERED`] or [`HAS_GRPC_CALLOUTS_STREAMING`]. + #### `proxy_grpc_close` @@ -1418,6 +1574,9 @@ Returned `status` value is: - `BAD_ARGUMENT` for invalid `call_or_stream_id`. - `UNKNOWN_RESOURCE_ID` for unknown `call_or_stream_id`. +This function is available if any of the following features is enabled: +[`HAS_GRPC_CALLOUTS_BUFFERED`] or [`HAS_GRPC_CALLOUTS_STREAMING`]. + ### Callbacks exposed by the Wasm module @@ -1435,6 +1594,9 @@ All metadata pairs can be retrieved using [`proxy_get_header_map_pairs`] or individually using [`proxy_get_header_map_value`] with `map_id` set to `GRPC_CALL_INITIAL_METADATA`. +This function is available if any of the following features is enabled: +[`HAS_GRPC_CALLOUTS_BUFFERED`] or [`HAS_GRPC_CALLOUTS_STREAMING`]. + #### `proxy_on_grpc_receive` @@ -1450,6 +1612,9 @@ Called when the response gRPC message for `call_id` sent using Message (of `message_size`) can be retrieved using [`proxy_get_buffer_bytes`] with `buffer_id` set to `GRPC_CALL_MESSAGE`. +This function is available if any of the following features is enabled: +[`HAS_GRPC_CALLOUTS_BUFFERED`] or [`HAS_GRPC_CALLOUTS_STREAMING`]. + #### `proxy_on_grpc_receive_trailing_metadata` @@ -1465,6 +1630,9 @@ All metadata pairs can be retrieved using [`proxy_get_header_map_pairs`] or individually using [`proxy_get_header_map_value`] with `map_id` set to `GRPC_CALL_TRAILING_METADATA`. +This function is available if any of the following features is enabled: +[`HAS_GRPC_CALLOUTS_BUFFERED`] or [`HAS_GRPC_CALLOUTS_STREAMING`]. + #### `proxy_on_grpc_close` @@ -1479,6 +1647,9 @@ Called when gRPC call or stream `call_id` opened using gRPC status message can be retrieved using [`proxy_get_status`]. +This function is available if any of the following features is enabled: +[`HAS_GRPC_CALLOUTS_BUFFERED`] or [`HAS_GRPC_CALLOUTS_STREAMING`]. + ## Shared Key-Value Store @@ -1515,6 +1686,8 @@ Returned `status` value is: - `INVALID_MEMORY_ACCESS` when `kvstore_name_data`, `kvstore_name_size` and/or `return_kvstore_id` point to invalid memory address. +This function is gated on [`HAS_KEY_VALUE_STORES`] host feature. + #### `proxy_set_shared_data` @@ -1546,6 +1719,8 @@ Returned `status` value is: - `INVALID_MEMORY_ACCESS` when `key_data`, `key_size`, `value_data`, `value_size` and/or `cas` point to invalid memory address. +This function is gated on [`HAS_KEY_VALUE_STORES`] host feature. + #### `proxy_get_shared_data` @@ -1576,6 +1751,8 @@ Returned `status` value is: `return_value_data`, `return_value_size` and/or `return_cas` point to invalid memory address. +This function is gated on [`HAS_KEY_VALUE_STORES`] host feature. + #### `proxy_delete_kvstore` @@ -1590,6 +1767,8 @@ Returned `status` value is: - `OK` on success. - `UNKNOWN_RESOURCE_ID` for unknown `kvstore_id`. +This function is gated on [`HAS_KEY_VALUE_STORES`] host feature. + ## Shared Queues @@ -1626,6 +1805,8 @@ Returned `status` value is: - `INVALID_MEMORY_ACCESS` when `vm_id_data`, `vm_id_size`, `name_data`, `name_size` and/or `return_queue_id` point to invalid memory address. +This function is gated on [`HAS_SHARED_QUEUES`] host feature. + #### `proxy_enqueue_shared_queue` @@ -1645,6 +1826,8 @@ Returned `status` value is: - `INVALID_MEMORY_ACCESS` when `value_data` and/or `value_size` point to invalid memory address. +This function is gated on [`HAS_SHARED_QUEUES`] host feature. + #### `proxy_dequeue_shared_queue` @@ -1665,6 +1848,8 @@ Returned `status` value is: - `INVALID_MEMORY_ACCESS` when `return_value_data` and/or `return_value_size` point to invalid memory address. +This function is gated on [`HAS_SHARED_QUEUES`] host feature. + #### `proxy_delete_shared_queue` @@ -1677,6 +1862,8 @@ Deletes previously created shared queue (`queue_id`). - `OK` on success. - `UNKNOWN_RESOURCE_ID` for unknown `queue_id`. +This function is gated on [`HAS_SHARED_QUEUES`] host feature. + ### Callbacks exposed by the Wasm module @@ -1688,6 +1875,8 @@ Deletes previously created shared queue (`queue_id`). Called when a new item is enqueued on the queue `queue_id`. +This function is gated on [`HAS_SHARED_QUEUES`] host feature. + ## Metrics @@ -1716,6 +1905,8 @@ Returned `status` value is: - `INVALID_MEMORY_ACCESS` when `name_data`, `name_size` and/or `return_metric_id` point to invalid memory address. +This function is gated on [`HAS_METRICS`] host feature. + #### `proxy_record_metric` @@ -1731,6 +1922,8 @@ Returned `status` value is: - `OK` on success. - `UNKNOWN_RESOURCE_ID` for unknown `metric_id`. +This function is gated on [`HAS_METRICS`] host feature. + #### `proxy_increment_metric` @@ -1748,6 +1941,8 @@ Returned `status` value is: - `BAD_ARGUMENT` when the requested `delta` cannot be applied to `metric_id` (e.g. trying to decrement counter). +This function is gated on [`HAS_METRICS`] host feature. + #### `proxy_get_metric` @@ -1765,6 +1960,8 @@ Returned `status` value is: - `INVALID_MEMORY_ACCESS` when `return_value` points to invalid memory address. +This function is gated on [`HAS_METRICS`] host feature. + ## Properties @@ -1800,6 +1997,8 @@ Returned `status` value is: `return_value_data` and/or `return_value_size` point to invalid memory address. +This function is gated on [`HAS_PROPERTIES`] host feature. + #### `proxy_set_property` @@ -1824,6 +2023,8 @@ Returned `status` value is: - `INVALID_MEMORY_ACCESS` when `path_data`, `path_size`, `value_data` and/or `value_size` point to invalid memory address. +This function is gated on [`HAS_PROPERTIES`] host feature. + ### Well-known properties @@ -1938,6 +2139,8 @@ Returned `status` value is: `arguments_data`, `arguments_size`, `return_results_data` and/or `return_results_size` point to invalid memory address. +This function is gated on [`HAS_CUSTOM_FUNCTIONS`] host feature. + ### Callbacks exposed by the Wasm module @@ -1956,6 +2159,8 @@ Its arguments (of `arguments_size`) can be retrieved using [`proxy_get_buffer_bytes`] with `buffer_id` set to `FOREIGN_FUNCTION_ARGUMENTS`. +This function is gated on [`HAS_CUSTOM_FUNCTIONS`] host feature. + ## Unimplemented WASI functions @@ -1981,6 +2186,8 @@ Returned `errno` value is: - `FAULT` when `return_argc` and/or `return_argv_buffer_size` point to invalid memory address. +This function is always supported. + #### `wasi_snapshot_preview1.args_get` @@ -1996,6 +2203,8 @@ in [`wasi_snapshot_preview1.args_sizes_get`]. Returned `errno` value is: - `SUCCESS` on success. +This function is always supported. + #### `wasi_snapshot_preview1.proc_exit` @@ -2013,6 +2222,17 @@ This function is never called. > The encoding of integers is little-endian. +#### List with host features + +A non-empty feature list is serialized as: +- 32-bit integer containing the number of features in the list, +- a series of pairs of 32-bit integers containing the feature identifier + and its value. + +An empty map may be represented either as an empty value (`size=0`), or as +a single `0x00` byte (`size=1`). + + #### Maps with HTTP fields and/or gRPC metadata Non-empty maps are serialized as: @@ -2102,7 +2322,7 @@ changes to unrelated connections/requests. - `EMPTY` = `7` - `CAS_MISMATCH` = `8` - `INTERNAL_FAILURE` = `10` -- `UNIMPLEMENTED` = `12` +- `NOT_SUPPORTED` = `12` - `UNKNOWN_RESOURCE_ID` = `13` - `CREATED` = `14` @@ -2185,6 +2405,26 @@ changes to unrelated connections/requests. [memory management]: #Memory-management [serialized]: #Serialization +[host features]: ./registries/HOST_FEATURES.md +[`HAS_CORE`]: ./registries/HOST_FEATURES.md +[`HAS_LOGGING`]: ./registries/HOST_FEATURES.md +[`HAS_HTTP_HEADERS`]: ./registries/HOST_FEATURES.md +[`HAS_HTTP_WITH_BODY`]: ./registries/HOST_FEATURES.md +[`HAS_HTTP_CALLOUTS_BUFFERED`]: ./registries/HOST_FEATURES.md +[`HAS_HTTP_CALLOUTS_STREAMING`]: ./registries/HOST_FEATURES.md +[`HAS_GRPC`]: ./registries/HOST_FEATURES.md +[`HAS_GRPC_CALLOUTS_BUFFERED`]: ./registries/HOST_FEATURES.md +[`HAS_GRPC_CALLOUTS_STREAMING`]: ./registries/HOST_FEATURES.md +[`HAS_TCP_FILTER`]: ./registries/HOST_FEATURES.md +[`HAS_TCP_WITH_PAYLOAD`]: ./registries/HOST_FEATURES.md +[`HAS_KEY_VALUE_STORES`]: ./registries/HOST_FEATURES.md +[`HAS_SHARED_QUEUES`]: ./registries/HOST_FEATURES.md +[`HAS_TIMERS`]: ./registries/HOST_FEATURES.md +[`HAS_METRICS`]: ./registries/HOST_FEATURES.md +[`HAS_PROPERTIES`]: ./registries/HOST_FEATURES.md +[`HAS_CUSTOM_FUNCTIONS`]: ./registries/HOST_FEATURES.md +[`HAS_WASI_PREVIEW1_CORE`]: ./registries/HOST_FEATURES.md + [`proxy_abi_version_0_x_x`]: #proxy_abi_version_0_x_x [`_initialize`]: #_initialize [`main`]: #main diff --git a/abi-versions/vNEXT/registries/HOST_FEATURES.md b/abi-versions/vNEXT/registries/HOST_FEATURES.md new file mode 100644 index 0000000..cbb1a63 --- /dev/null +++ b/abi-versions/vNEXT/registries/HOST_FEATURES.md @@ -0,0 +1,31 @@ +# Host features + +| Identifier | Name | Value | +|:----------:|:-------------------------------|:----------------------------------------------------------------------------------------------| +| 0x0001 | `HAS_CORE` | When non-zero, all baseline functions considered essential are supported. | +| 0x0002 | `HAS_LOGGING` | When non-zero, all baseline functions for logging are supported. | +| 0x0003 | `HAS_HTTP_HEADERS` | When non-zero, only baseline functions related to HTTP headers are supported. | +| 0x0004 | `HAS_HTTP_WITH_BODY` | When non-zero, all baseline functions for HTTP are supported. | +| 0x0005 | `HAS_HTTP_CALLOUTS_BUFFERED` | When non-zero, all baseline functions for buffered HTTP callouts are supported. | +| 0x0006 | `HAS_HTTP_CALLOUTS_STREAMING` | When non-zero, all baseline functions for streaming HTTP callouts are supported. | +| 0x0007 | `HAS_GRPC` | When non-zero, all baseline functions for gRPC are supported. | +| 0x0008 | `HAS_GRPC_CALLOUTS_BUFFERED` | When non-zero, all baseline functions for buffered gRPC callouts are supported. | +| 0x0009 | `HAS_GRPC_CALLOUTS_STREAMING` | When non-zero, all baseline functions for streaming gRPC callouts are supported. | +| 0x000A | `HAS_TCP_FILTER` | When non-zero, only baseline functions related to new TCP connections are supported. | +| 0x000B | `HAS_TCP_WITH_PAYLOAD` | When non-zero, all baseline functions for TCP are supported. | +| 0x000C | `HAS_KEY_VALUE_STORES` | When non-zero, all baseline functions for key-value stores are supported. | +| 0x000D | `HAS_SHARED_QUEUES` | When non-zero, all baseline functions for shared queues are supported. | +| 0x000E | `HAS_TIMERS` | When non-zero, all baseline functions for timers are supported. | +| 0x000F | `HAS_METRICS` | When non-zero, all baseline functions for metrics are supported. | +| 0x0010 | `HAS_PROPERTIES` | When non-zero, all baseline functions for properties are supported. | +| 0x0011 | `HAS_CUSTOM_FUNCTIONS` | When non-zero, all baseline functions for custom functions are supported. | +| 0x0F01 | `HAS_WASI_PREVIEW1_CORE` | When non-zero, all baseline functions considered essential from WASI Preview1 are supported. | + + +Identifiers below 0x2000 are reserved for standardized features and options. + +Numbers above that range are considered private and can be used without assignment in the registry. + +Random number in the private range should be used for private extensions and features under active development. + +Once the feature is finalized and implemented in a subset of hosts and SDKs, it will be assigned identifier in the standardized range.