// This is a pure C header file that defines the ABI of the core of dynamic modules used by Envoy.
// Some functions are specified/defined under the assumptions that all dynamic modules are trusted
// and have the same privilege level as the main Envoy program. This is because they run inside the
// can, which makes it impossible to enforce any security boundaries between Envoy and the modules
// This is the ABI version that we bump the minor version at least once for any ABI changes in same
// compatibility in the next minor version. For example, v0.1.y is guaranteed to be compatible with
// 1. Envoy's version is generated at the build time of Envoy while we need to make it available for
// 2. In the future, after the stable ABI is established, we may want to decouple the ABI version
* contains the ABI version of the dynamic module. This is used to ensure that the dynamic module is
* OWNERSHIP: The module is responsible for managing the lifetime of the pointer. It depends on the
* context where the buffer is used. See for the specific event hook or callback for more details.
* envoy_dynamic_module_type_buffer_envoy_ptr is a pointer to a buffer in Envoy. A buffer represents
* OWNERSHIP: Envoy owns the pointer. The lifetime depends on the context where the buffer is used.
* envoy_dynamic_module_type_module_http_header represents a key-value pair of an HTTP header owned
* envoy_dynamic_module_type_envoy_http_header represents a key-value pair of an HTTP header owned
* MissingRequiredHeaders means the callout is missing one of the required headers, :path, :method,
* ClusterNotFound means the cluster is not found in the configuration. CannotCreateRequest means
* the request cannot be created. That happens when, for example, there's no healthy upstream host
* This corresponds to `AsyncClient::FailureReason::*` in envoy/http/async_client.h plus Success.
* MetricNotFound means the metric was not found. This is usually an indication that a handle was
* envoy_dynamic_module_type_metadata_source represents the location of metadata to get when calling
* envoy_dynamic_module_type_socket_option represents a socket option with its level, name, state,
* applied to the upstream (outgoing to backend) or downstream (incoming from client) connection.
* Note that initialization routines of a dynamic module can also be performed without this function
* envoy_dynamic_module_callback_log_enabled is called by the module to check if the log level is
* module in envoy_dynamic_module_on_program_init to get the configured concurrency of the server.
* envoy_dynamic_module_callback_register_function registers an opaque function pointer under the
* given key in the process-wide function registry. This allows modules loaded in the same process
* to expose functions that other modules can resolve by name and call directly, enabling zero-copy
* Callers are responsible for agreeing on the function signature out-of-band, since the registry
* @return true if registered successfully, false if a function is already registered under key or
bool envoy_dynamic_module_callback_register_function(envoy_dynamic_module_type_module_buffer key,
* envoy_dynamic_module_callback_get_function retrieves a previously registered function pointer by
* process to share arbitrary state — such as runtime handles, configuration snapshots, or shared
bool envoy_dynamic_module_callback_register_shared_data(envoy_dynamic_module_type_module_buffer key,
* envoy_dynamic_module_callback_get_shared_data retrieves a previously registered data pointer by
* key from the process-wide shared data registry. The returned pointer can be cast to the expected
* configuration corresponding to an Envoy HTTP filter configuration. The config is responsible for
* OWNERSHIP: The module is responsible for managing the lifetime of the pointer. The pointer can be
* released when envoy_dynamic_module_on_http_filter_config_destroy is called for the same pointer.
* envoy_dynamic_module_type_http_filter_per_route_config_module_ptr is a pointer to an in-module
* HTTP configuration corresponding to an Envoy HTTP per route filter configuration. The config is
* OWNERSHIP: The module is responsible for managing the lifetime of the pointer. The pointer can be
* released when envoy_dynamic_module_on_http_filter_per_route_config_destroy is called for the same
* envoy_dynamic_module_type_http_filter_envoy_ptr is a raw pointer to the DynamicModuleHttpFilter
* class in Envoy. This is passed to the module when creating a new HTTP filter for each HTTP stream
* This has 1:1 correspondence with envoy_dynamic_module_type_http_filter_module_ptr in the module.
* corresponding to an Envoy HTTP filter. The filter is responsible for processing each HTTP stream.
* OWNERSHIP: The module is responsible for managing the lifetime of the pointer. The pointer can be
* envoy_dynamic_module_callback_http_filter_config_scheduler_new and the scheduling and destruction
* is done by envoy_dynamic_module_callback_http_filter_config_scheduler_delete. Since its lifecycle
* filter after processing the HTTP request headers. This corresponds to `FilterHeadersStatus` in
* envoy_dynamic_module_type_on_http_filter_request_body_status represents the status of the filter
* filter after processing the HTTP request trailers. This corresponds to `FilterTrailersStatus` in
* filter after processing the HTTP response headers. This corresponds to `FilterHeadersStatus` in
* envoy_dynamic_module_type_on_http_filter_response_body_status represents the status of the filter
* envoy_dynamic_module_type_on_http_filter_response_trailers_status represents the status of the
* filter after processing the HTTP response trailers. This corresponds to `FilterTrailersStatus` in
* envoy_dynamic_module_type_on_http_filter_local_reply_status represents the action to take after
* the onLocalReply hook completes. This corresponds to `LocalErrorStatus` in envoy/http/filter.h.
// Continue sending onLocalReply to all filters, but reset the stream once all filters have been
* envoy_dynamic_module_type_http_stream_reset_reason represents the reason for resetting the main
* HTTP stream. This corresponds to `Http::StreamResetReason` in envoy/http/stream_reset_handler.h.
* @param filter_config_envoy_ptr is the pointer to the DynamicModuleHttpFilterConfig object for the
* envoy_dynamic_module_on_http_filter_config_destroy is called when the HTTP filter configuration
* is destroyed in Envoy. The module should release any resources associated with the corresponding
* envoy_dynamic_module_on_http_filter_per_route_config_new is called by the main thread when the
* @return envoy_dynamic_module_type_http_filter_per_route_config_module_ptr is the pointer to the
* configuration is destroyed in Envoy. The module should release any resources associated with the
* envoy_dynamic_module_on_http_filter_new is called when the HTTP filter is created for each HTTP
* filter. Returning nullptr indicates a failure to initialize the module. When it fails, the stream
* envoy_dynamic_module_on_http_filter_request_headers is called when the HTTP request headers are
* @return envoy_dynamic_module_type_on_http_filter_request_body_status is the status of the filter.
* envoy_dynamic_module_on_http_filter_request_trailers is called when the HTTP request trailers are
* envoy_dynamic_module_on_http_filter_response_headers is called when the HTTP response headers are
* envoy_dynamic_module_on_http_filter_response_trailers is called when the HTTP response trailers
* @return envoy_dynamic_module_type_on_http_filter_response_trailers_status is the status of the
* envoy_dynamic_module_on_http_filter_stream_complete is called when the HTTP stream is complete.
* This is called before envoy_dynamic_module_on_http_filter_destroy and access logs are flushed.
* envoy_dynamic_module_on_http_filter_destroy is called when the HTTP filter is destroyed for each
* headers and body_chunks are owned by Envoy, and they are guaranteed to be valid until the end of
* envoy_dynamic_module_on_http_filter_http_stream_data is called when a chunk of response body is
* received for a streamable HTTP callout stream. This may be called multiple times for a single
* envoy_dynamic_module_on_http_filter_http_stream_trailers is called when response trailers are
* received for a streamable HTTP callout stream. This is called after headers and any data chunks.
* callout stream completes successfully. This is called after all headers, data, and trailers have
* envoy_dynamic_module_on_http_filter_http_stream_reset is called when a streamable HTTP callout
* @param filter_config_ptr is the pointer to the in-module HTTP filter configuration created by
* @param filter_config_ptr is the pointer to the in-module HTTP filter configuration created by
* headers and body_chunks are owned by Envoy, and they are guaranteed to be valid until the end of
envoy_dynamic_module_type_http_filter_config_module_ptr filter_config_ptr, uint64_t callout_id,
* envoy_dynamic_module_on_http_filter_config_http_stream_headers is called when response headers
* @param filter_config_ptr is the pointer to the in-module HTTP filter configuration created by
* envoy_dynamic_module_on_http_filter_config_http_stream_data is called when a chunk of response
* body is received for a streamable HTTP callout started from an HTTP filter configuration. This
* @param filter_config_ptr is the pointer to the in-module HTTP filter configuration created by
* envoy_dynamic_module_on_http_filter_config_http_stream_trailers is called when response trailers
* @param filter_config_ptr is the pointer to the in-module HTTP filter configuration created by
* envoy_dynamic_module_on_http_filter_config_http_stream_complete is called when a streamable HTTP
* callout stream started from an HTTP filter configuration completes successfully. This is called
* @param filter_config_ptr is the pointer to the in-module HTTP filter configuration created by
envoy_dynamic_module_type_http_filter_config_module_ptr filter_config_ptr, uint64_t stream_id);
* envoy_dynamic_module_on_http_filter_config_http_stream_reset is called when a streamable HTTP
* @param filter_config_ptr is the pointer to the in-module HTTP filter configuration created by
* envoy_dynamic_module_on_http_filter_downstream_above_write_buffer_high_watermark is called when
* the buffer for the downstream stream goes over the high watermark for a terminal filter. This may
* be called multiple times, in which case envoy_dynamic_module_on_above_write_buffer_low_watermark
* will be called an equal number of times until the write buffer is completely drained below the
* envoy_dynamic_module_on_http_filter_downstream_below_write_buffer_low_watermark is called when
* any buffer for the response stream goes from over its high watermark to under its low watermark
* envoy_dynamic_module_on_http_filter_local_reply is called when sendLocalReply is invoked on the
* HTTP stream. This allows filters to be notified when a local reply is being generated, which is
* @return envoy_dynamic_module_type_on_http_filter_local_reply_status indicating the action to take
* during initialization to create a template for generating Stats::Counters with the given name and
* @param filter_config_envoy_ptr is the pointer to the DynamicModuleHttpFilterConfig in which the
* @param counter_id_ptr where the opaque ID that represents a unique metric will be stored. This
* initialization to create a template for generating Stats::Gauges with the given name and labels
* @param filter_config_envoy_ptr is the pointer to the DynamicModuleHttpFilterConfig in which the
* @param gauge_id_ptr where the opaque ID that represents a unique metric will be stored. This can
* envoy_dynamic_module_callback_http_filter_increment_gauge is called by the module to increase
envoy_dynamic_module_type_metrics_result envoy_dynamic_module_callback_http_filter_increment_gauge(
* envoy_dynamic_module_callback_http_filter_decrement_gauge is called by the module to decrease
envoy_dynamic_module_type_metrics_result envoy_dynamic_module_callback_http_filter_decrement_gauge(
* during initialization to create a template for generating Stats::Histograms with the given name
* @param filter_config_envoy_ptr is the pointer to the DynamicModuleHttpFilterConfig in which the
* @param histogram_id_ptr where the opaque ID that represents a unique metric will be stored. This
* can be passed to envoy_dynamic_module_callback_http_filter_record_histogram_value_vec together
* index is used to get the specific value. This returns the number of values for the given key, so
* it can be used to iterate over all values by starting from 0 and incrementing the index until the
* @param result_buffer is the buffer where the value will be stored. If the key does not exist or
* @param optional_size is the pointer to the variable where the number of values for the given key
* NOTE: This parameter is optional and can be null if the module does not need this information.
* Note that a header value is not guaranteed to be a valid UTF-8 string. The module must be careful
* The buffer pointed by the pointer stored in result_buffer_ptr is owned by Envoy, and they are
* PRECONDITION: The module must ensure that the result_headers is valid and has enough length to
* @param result_headers is the pointer to the array of envoy_dynamic_module_type_envoy_http_header
* where the headers will be stored. The lifetime of the buffer of key and value of each header is
* created. If the header already exists, all existing values will be removed and the new value will
* Note that this only adds the header to the underlying Envoy object. Whether or not the header is
* filters. In other words, returning true from this function does not guarantee that the header
* created. If the header already exists, all existing values will be removed and the new value will
* Note that this only sets the header to the underlying Envoy object. Whether or not the header is
* filters. In other words, returning true from this function does not guarantee that the header
* envoy_dynamic_module_callback_http_send_response is called by the module to send the response
* @param headers_vector is the array of envoy_dynamic_module_type_module_http_header that contains
* The response code details is an optional short string that provides additional information about
* why this response code was sent like "rate_limited". It is typically used for logging purposes.
envoy_dynamic_module_type_module_buffer body, envoy_dynamic_module_type_module_buffer details);
* @param headers_vector is the array of envoy_dynamic_module_type_module_http_header that contains
* envoy_dynamic_module_callback_http_send_response_data is called by the module to send response
* envoy_dynamic_module_callback_http_send_response_trailers is called by the module to send the
* @param trailers_vector is the array of envoy_dynamic_module_type_module_http_header that contains
* NOTE: Envoy will handle the request/response as a stream of data. Therefore, the body may not be
* available in its entirety before the end of stream flag is set. The Envoy will provides both the
* buffered so far) to the module. The module should be aware of this distinction when processing
* NOTE: The buffered body, however, is always available. But only the latest data processing filter
* in the filter chain could modify the buffered body. That is say for a given filter X, filter X
* can safely modify the buffered body if and only if the filters following filter X in the filter
* PRECONDITION: The module must ensure that the result_buffer_vector is valid and has enough length
* @param result_buffer_vector is the pointer to the array of envoy_dynamic_module_type_envoy_buffer
* where the buffers of the body will be stored. The lifetime of the buffer is guaranteed until the
* @param body_type is the type of the body to get the number of buffers from (request/response,
* For example, the previous filter X have stopped the filter chain and buffered the request body.
* @return true if the latest received request body is the previously buffered request body, false
* envoy_dynamic_module_callback_http_received_buffered_response_body is called by the module to
* check if the latest received response body actually is the previously buffered response body.
* For example, the previous filter X have stopped the filter chain and buffered the response body.
* When the next filter Y will receives the buffered response body and this callback will return
* @return true if the latest received response body is the previously buffered response body, false
* envoy_dynamic_module_callback_http_set_dynamic_metadata_number is called by the module to set
* the number value of the dynamic metadata with the given namespace and key. If the metadata is
* the number value of the dynamic metadata with the given namespace and key. If the metadata is not
* accessible, the namespace does not exist, the key does not exist or the value is not a number,
* @param result is the pointer to the variable where the number value of the dynamic metadata will
* envoy_dynamic_module_callback_http_set_dynamic_metadata_string is called by the module to set
* the string value of the dynamic metadata with the given namespace and key. If the metadata is
* the string value of the dynamic metadata with the given namespace and key. If the metadata is not
* accessible, the namespace does not exist, the key does not exist or the value is not a string,
* the bool value of the dynamic metadata with the given namespace and key. If the metadata is not
* @param result is the pointer to the variable where the bool value of the dynamic metadata will
* envoy_dynamic_module_callback_http_get_metadata_keys_count is called by the module to get the
* PRECONDITION: The module must ensure that the result_buffer_vector is valid and has enough length
* @param result_buffer_vector is the pointer to the array of envoy_dynamic_module_type_envoy_buffer
* envoy_dynamic_module_callback_http_get_metadata_namespaces_count is called by the module to get
* envoy_dynamic_module_callback_http_get_metadata_namespaces is called by the module to get all
* PRECONDITION: The module must ensure that the result_buffer_vector is valid and has enough length
* @param result_buffer_vector is the pointer to the array of envoy_dynamic_module_type_envoy_buffer
* where the namespace strings will be stored. The lifetime of the buffer is guaranteed until the
* envoy_dynamic_module_callback_http_add_dynamic_metadata_list_number is called by the module to
* append a number value to the dynamic metadata list stored under the given namespace and key. If
* the key does not exist, a new list is created. If the key exists but is not a list, this returns
* envoy_dynamic_module_callback_http_add_dynamic_metadata_list_string is called by the module to
* append a string value to the dynamic metadata list stored under the given namespace and key. If
* the key does not exist, a new list is created. If the key exists but is not a list, this returns
* append a bool value to the dynamic metadata list stored under the given namespace and key. If the
* number of elements in the metadata list stored under the given namespace and key. If the metadata
* is not accessible, the namespace does not exist, the key does not exist, or the value is not a
* envoy_dynamic_module_callback_http_get_metadata_list_number is called by the module to get the
* number value at the given index in the metadata list stored under the given namespace and key. If
* the metadata is not accessible, the namespace does not exist, the key does not exist, the value
* is not a list, the index is out of range, or the element at index is not a number, this returns
* envoy_dynamic_module_callback_http_get_metadata_list_string is called by the module to get the
* string value at the given index in the metadata list stored under the given namespace and key. If
* the metadata is not accessible, the namespace does not exist, the key does not exist, the value
* is not a list, the index is out of range, or the element at index is not a string, this returns
* lifetime of the buffer is guaranteed until the end of the current event hook unless the setter
* bool value at the given index in the metadata list stored under the given namespace and key. If
* the metadata is not accessible, the namespace does not exist, the key does not exist, the value
* is not a list, the index is out of range, or the element at index is not a bool, this returns
* bytes value of the filter state with the given key. If the filter state is not accessible, this
* @return true if the operation is successful, false otherwise. Different from setting metadata,
* bytes value of the filter state with the given key. If the filter state is not accessible, the
* StringAccessor, this uses the registered ObjectFactory for the key to create a properly typed
* object generically and calls serializeAsString to get the bytes representation. This works with
* @return true if the operation is successful, false if the stream info is not available, the key
* envoy_dynamic_module_callback_http_add_custom_flag is called by the module to add a custom flag
* concatenated with comma. It should not contain any empty or space characters (' ', '\t', '\f',
* characters (' ', '\t', '\f', '\v', '\n', '\r') and should be very short to indicate a noteworthy
* envoy_dynamic_module_callback_http_filter_scheduler_new is called by the module to create a new
* HTTP filter scheduler. The scheduler is used to dispatch HTTP filter operations from any thread
* the HTTP filter scheduler created by envoy_dynamic_module_callback_http_filter_scheduler_new.
* envoy_dynamic_module_callback_http_filter_config_scheduler_new is called by the module to create
* configuration operations to the main thread from any thread including the ones managed by the
* @return envoy_dynamic_module_type_http_filter_config_scheduler_module_ptr is the pointer to the
* envoy_dynamic_module_callback_http_filter_config_scheduler_delete when it is no longer needed.
* @param scheduler_module_ptr is the pointer to the HTTP filter configuration scheduler created by
* This can be called multiple times to schedule multiple events to the same filter configuration.
* @param scheduler_module_ptr is the pointer to the HTTP filter configuration scheduler created by
* envoy_dynamic_module_callback_http_clear_route_cache is called by the module to clear the route
* envoy_dynamic_module_callback_http_filter_get_attribute_string is called by the module to get
* @param result is the pointer to the variable where the integer value of the attribute will be
* @param callout_id_out is a pointer to a variable where the callout ID will be stored. This can be
* @param headers is the headers of the request. It must contain :method, :path and host headers.
* a streamable HTTP callout to a specified cluster. Unlike the one-shot HTTP callout, this allows
* the module to receive response headers, body chunks, and trailers through separate event hooks,
* 3. envoy_dynamic_module_on_http_filter_http_stream_trailers - when trailers arrive (optional)
* 4. envoy_dynamic_module_on_http_filter_http_stream_complete - when stream completes successfully
* @param headers is the headers of the request. It must contain :method, :path and host headers.
* @param end_stream is true if the request stream should be ended after sending headers and body.
* @param timeout_milliseconds is the timeout for the stream in milliseconds. If 0, no timeout is
* or cancel an ongoing streamable HTTP callout. This causes the stream to be terminated and the
* @param callout_id_out is a pointer to a variable where the callout ID will be stored. This can
* be arbitrary and is used to differentiate between multiple calls from the same filter config.
* @param headers is the headers of the request. It must contain :method, :path and host headers.
* envoy_dynamic_module_callback_http_filter_config_start_http_stream is called by the module to
* start a streamable HTTP callout from an HTTP filter configuration context. Unlike the one-shot
* 2. envoy_dynamic_module_on_http_filter_config_http_stream_data (may be called multiple times)
* @param headers is the headers of the request. It must contain :method, :path and host headers.
* @param end_stream is true if the request stream should be ended after sending headers and body.
* @param timeout_milliseconds is the timeout for the stream in milliseconds. If 0, no timeout is
* envoy_dynamic_module_callback_http_filter_config_reset_http_stream is called by the module to
* configuration context. This can be called multiple times to stream the request body in chunks.
* envoy_dynamic_module_callback_http_filter_config_stream_send_trailers is called by the module to
* envoy_dynamic_module_callback_http_filter_continue_decoding is called by the module to continue
* envoy_dynamic_module_callback_http_filter_continue_encoding is called by the module to continue
* @param filter_envoy_ptr is the pointer to the DynamicModuleHttpFilter object of the corresponding
* envoy_dynamic_module_callback_http_filter_get_worker_index is called by the module to get the
* @param value_out is the pointer to store the retrieved buffer. The buffer is owned by Envoy and
* envoy_dynamic_module_callback_http_get_buffer_limit retrieves the current buffer limit for the
* envoy_dynamic_module_callback_http_set_buffer_limit sets the buffer limit for the HTTP filter.
* This controls the maximum amount of data that can be buffered for body data before backpressure
* It is recommended (but not required) that filters calling this function should generally only
* envoy_dynamic_module_type_span_envoy_ptr is a raw pointer to the active Tracing::Span in Envoy.
void envoy_dynamic_module_callback_http_span_set_tag(envoy_dynamic_module_type_span_envoy_ptr span,
* envoy_dynamic_module_callback_http_span_set_operation sets the operation name on the given span.
* envoy_dynamic_module_callback_http_span_set_sampled overrides the sampling decision for the span.
* @param result is the pointer to store the baggage value. The buffer uses thread-local storage
envoy_dynamic_module_type_span_envoy_ptr span, envoy_dynamic_module_type_envoy_buffer* result);
envoy_dynamic_module_type_span_envoy_ptr span, envoy_dynamic_module_type_envoy_buffer* result);
envoy_dynamic_module_type_child_span_module_ptr envoy_dynamic_module_callback_http_span_spawn_child(
* envoy_dynamic_module_callback_http_get_cluster_name retrieves the name of the cluster that the
* health state and can be used to implement scale-to-zero logic or custom load balancing decisions.
* @param total_count is the pointer to store the total number of hosts. Can be null if not needed.
* @param degraded_count is the pointer to store the number of degraded hosts. Can be null if not
* envoy_dynamic_module_callback_http_set_upstream_override_host sets the override host to be used
* by the upstream load balancer. If the target host exists in the host list of the routed cluster,
* @param host is the host address to override (e.g., "10.0.0.1:8080"). Must be a valid IP address.
* @param strict if true, the request will fail if the override host is not available. If false,
* @return true if the override host was set successfully, false if the host address is invalid.
* envoy_dynamic_module_callback_http_filter_reset_stream resets the HTTP stream with the specified
* reason. This is useful for terminating the stream when an error condition is detected or when
* After calling this function, no further filter callbacks will be invoked for this stream except
* envoy_dynamic_module_callback_http_filter_recreate_stream recreates the HTTP stream, optionally
* After calling this function successfully, the current filter chain will be destroyed and a new
* envoy_dynamic_module_callback_http_clear_route_cluster_cache clears only the cluster selection
* This is a subset of envoy_dynamic_module_callback_http_clear_route_cache. Use this when a filter
* modifies headers that affect cluster selection but not the route itself. This is more efficient
* This has 1:1 correspondence with envoy_dynamic_module_type_network_filter_config_module_ptr in
* envoy_dynamic_module_type_network_filter_config_module_ptr is a pointer to an in-module network
* OWNERSHIP: The module is responsible for managing the lifetime of the pointer. The pointer can be
* network filter for each TCP connection and used to access the network filter-scoped information
* envoy_dynamic_module_type_network_filter_module_ptr is a pointer to an in-module network filter
* OWNERSHIP: The module is responsible for managing the lifetime of the pointer. The pointer can be
* envoy_dynamic_module_callback_network_filter_scheduler_new and the scheduling and destruction is
* done by envoy_dynamic_module_callback_network_filter_scheduler_delete. Since its lifecycle is
* when scheduling the network filter config event is done. The creation of this pointer is done by
* after processing data. This corresponds to `Network::FilterStatus` in envoy/network/filter.h.
* envoy_dynamic_module_type_network_connection_close_type represents how to close the connection.
// Flush pending write data and delay raising ConnectionEvent::LocalClose until the delayed_close
* envoy_dynamic_module_type_network_connection_state represents the current state of a connection.
* envoy_dynamic_module_on_network_filter_config_new is called by the main thread when the network
* @param filter_config_envoy_ptr is the pointer to the DynamicModuleNetworkFilterConfig object for
* in-module network filter configuration. Returning nullptr indicates a failure to initialize the
* envoy_dynamic_module_on_network_filter_new is called when a new network filter is created for
* network filter. Returning nullptr indicates a failure to initialize the module. When it fails,
envoy_dynamic_module_type_network_filter_module_ptr envoy_dynamic_module_on_network_filter_new(
envoy_dynamic_module_type_on_network_filter_data_status envoy_dynamic_module_on_network_filter_read(
* envoy_dynamic_module_on_network_filter_destroy is called when the network filter is destroyed
* headers and body_chunks are owned by Envoy, and they are guaranteed to be valid until the end of
* envoy_dynamic_module_on_network_filter_config_scheduled is called when the event is scheduled via
* write buffer for the connection goes from over its high watermark to under its low watermark.
* envoy_dynamic_module_callback_network_set_socket_option_int sets an integer socket option with
* envoy_dynamic_module_callback_network_set_socket_option_bytes sets a bytes socket option with
* envoy_dynamic_module_callback_network_get_socket_option_int retrieves an integer socket option
* envoy_dynamic_module_callback_network_get_socket_option_bytes retrieves a bytes socket option
* @param value_out is the pointer to store the retrieved buffer. The buffer is owned by Envoy and
* envoy_dynamic_module_callback_network_get_socket_options gets all socket options stored on the
* envoy_dynamic_module_callback_network_get_socket_options_size to get the size, allocate an array
* @param options_out is the pointer to an array of socket options that will be filled. The array
* envoy_dynamic_module_callback_network_filter_get_read_buffer_chunks_size is called by the module
* envoy_dynamic_module_callback_network_filter_get_read_buffer_chunks, this can be used to iterate
* envoy_dynamic_module_callback_network_filter_get_read_buffer_chunks is called by the module to
* PRECONDITION: The module must ensure that the result_buffer_vector is valid and has enough length
* envoy_dynamic_module_callback_network_filter_get_read_buffer_chunks_size to get the number of
* @param result_buffer_vector is the pointer to the array of envoy_dynamic_module_type_envoy_buffer
* where the chunks will be stored. The lifetime of the buffer is guaranteed until the end of the
* envoy_dynamic_module_callback_network_filter_get_write_buffer_chunks_size is called by the module
* envoy_dynamic_module_callback_network_filter_get_write_buffer_chunks, this can be used to iterate
* envoy_dynamic_module_callback_network_filter_get_write_buffer_size is called by the module to
* envoy_dynamic_module_callback_network_filter_get_write_buffer_chunks is called by the module to
* PRECONDITION: The module must ensure that the result_buffer_vector is valid and has enough length
* envoy_dynamic_module_callback_network_filter_get_write_buffer_chunks_size to get the number of
* @param result_buffer_vector is the pointer to the array of envoy_dynamic_module_type_envoy_buffer
* where the chunks will be stored. The lifetime of the buffer is guaranteed until the end of the
* envoy_dynamic_module_callback_network_filter_drain_read_buffer is called by the module to drain
* envoy_dynamic_module_callback_network_filter_drain_write_buffer is called by the module to drain
* envoy_dynamic_module_callback_network_filter_inject_read_data is called by the module to inject
* envoy_dynamic_module_callback_network_filter_inject_write_data is called by the module to inject
* envoy_dynamic_module_callback_network_filter_get_connection_id is called by the module to get
* envoy_dynamic_module_callback_network_filter_get_remote_address is called by the module to get
* envoy_dynamic_module_callback_network_filter_get_local_address is called by the module to get
* envoy_dynamic_module_callback_network_filter_disable_close is called by the module to disable
* envoy_dynamic_module_callback_network_filter_close_with_details is called by the module to close
* envoy_dynamic_module_callback_network_filter_get_requested_server_name is called by the module
* envoy_dynamic_module_callback_network_filter_get_direct_remote_address is called by the module
* envoy_dynamic_module_callback_network_filter_get_ssl_uri_sans_size is called by the module to
* @param sans_out is a pre-allocated array owned by the module where Envoy will populate the SANs.
* The module must allocate this array with at least the size returned by get_ssl_uri_sans_size.
* envoy_dynamic_module_callback_network_filter_get_ssl_dns_sans_size is called by the module to
* @param sans_out is a pre-allocated array owned by the module where Envoy will populate the SANs.
* The module must allocate this array with at least the size returned by get_ssl_dns_sans_size.
* filter state with a bytes value. The filter state can be read by other filters in the chain and
envoy_dynamic_module_type_module_buffer key, envoy_dynamic_module_type_envoy_buffer* value_out);
* typed filter state using the registered ObjectFactory for the key. Unlike set_filter_state_bytes
* @param key is the key name owned by the module. This must match a registered ObjectFactory name.
* the object generically and calls serializeAsString to get the bytes representation. This works
* @param value_out is the output buffer where the serialized value owned by Envoy will be stored.
envoy_dynamic_module_type_module_buffer key, envoy_dynamic_module_type_envoy_buffer* value_out);
* set the string value of the dynamic metadata with the given namespace and key. If the metadata
* get the string value of the dynamic metadata with the given namespace and key. If the namespace
envoy_dynamic_module_type_module_buffer key, envoy_dynamic_module_type_envoy_buffer* value_out);
* set the number value of the dynamic metadata with the given namespace and key. If the metadata
* get the number value of the dynamic metadata with the given namespace and key. If the namespace
* get the bool value of the dynamic metadata with the given namespace and key. If the namespace
* envoy_dynamic_module_callback_network_filter_http_callout is called by the module to initiate an
* @param callout_id_out is a pointer to a variable where the callout ID will be stored. This can be
* @param headers is the headers of the request. It must contain :method, :path and host headers.
* @param counter_id_ptr where the opaque ID that represents a unique metric will be stored. This
* can be passed to envoy_dynamic_module_callback_network_filter_increment_counter together with
envoy_dynamic_module_type_network_filter_envoy_ptr filter_envoy_ptr, size_t id, uint64_t value);
* envoy_dynamic_module_callback_network_filter_config_define_gauge is called by the module during
* envoy_dynamic_module_callback_network_filter_set_gauge is called by the module to set the value
envoy_dynamic_module_type_metrics_result envoy_dynamic_module_callback_network_filter_set_gauge(
envoy_dynamic_module_type_network_filter_envoy_ptr filter_envoy_ptr, size_t id, uint64_t value);
* envoy_dynamic_module_callback_network_filter_increment_gauge is called by the module to increase
envoy_dynamic_module_type_network_filter_envoy_ptr filter_envoy_ptr, size_t id, uint64_t value);
* envoy_dynamic_module_callback_network_filter_decrement_gauge is called by the module to decrease
envoy_dynamic_module_type_network_filter_envoy_ptr filter_envoy_ptr, size_t id, uint64_t value);
* envoy_dynamic_module_callback_network_filter_record_histogram_value is called by the module to
envoy_dynamic_module_type_network_filter_envoy_ptr filter_envoy_ptr, size_t id, uint64_t value);
* envoy_dynamic_module_callback_network_filter_get_cluster_host_count retrieves the host counts for
* a cluster by name. This provides visibility into the cluster's health state and can be used to
* @param total_count is the pointer to store the total number of hosts. Can be null if not needed.
* @param degraded_count is the pointer to store the number of degraded hosts. Can be null if not
* envoy_dynamic_module_callback_network_filter_get_upstream_host_address is called by the module
* @param address_out is the output buffer where the address string owned by Envoy will be stored.
* envoy_dynamic_module_callback_network_filter_get_upstream_host_hostname is called by the module
* @param hostname_out is the output buffer where the hostname string owned by Envoy will be stored.
* envoy_dynamic_module_callback_network_filter_get_upstream_host_cluster is called by the module
* @param cluster_name_out is the output buffer where the cluster name string owned by Envoy will
* envoy_dynamic_module_callback_network_filter_has_upstream_host is called by the module to check
* envoy_dynamic_module_callback_network_filter_start_upstream_secure_transport is called by the
* This is done when the upstream connection's transport socket is of startTLS type. At the moment
* envoy_dynamic_module_callback_network_filter_get_connection_state is called by the module to get
* When reads are disabled, no more data will be read from the socket. When re-enabled, if there
* envoy_dynamic_module_callback_network_filter_read_enabled is called by the module to check if
* envoy_dynamic_module_callback_network_filter_is_half_close_enabled is called by the module to
* envoy_dynamic_module_callback_network_filter_enable_half_close is called by the module to enable
* envoy_dynamic_module_callback_network_filter_set_buffer_limits is called by the module to set
* it triggers envoy_dynamic_module_on_network_filter_above_write_buffer_high_watermark callback.
* envoy_dynamic_module_callback_network_filter_scheduler_new is called by the module to create a
* new network filter scheduler. The scheduler is used to dispatch network filter operations from
* envoy_dynamic_module_callback_network_filter_scheduler_delete is called by the module to delete
* create a new network filter configuration scheduler. The scheduler is used to dispatch network
* filter configuration operations to the main thread from any thread including the ones managed by
* @param filter_config_envoy_ptr is the pointer to the DynamicModuleNetworkFilterConfig object.
* @return envoy_dynamic_module_type_network_filter_config_scheduler_module_ptr is the pointer to
* envoy_dynamic_module_callback_network_filter_config_scheduler_delete when it is no longer needed.
* envoy_dynamic_module_callback_network_filter_config_scheduler_delete is called by the module to
* @param scheduler_module_ptr is the pointer to the network filter configuration scheduler created
* envoy_dynamic_module_callback_network_filter_config_scheduler_commit is called by the module to
* This can be called multiple times to schedule multiple events to the same filter configuration.
* @param scheduler_module_ptr is the pointer to the network filter configuration scheduler created
* envoy_dynamic_module_callback_network_filter_get_worker_index is called by the module to get the
* worker index assigned to the current network filter. This can be used by the module to manage
* This has 1:1 correspondence with envoy_dynamic_module_type_listener_filter_config_module_ptr in
* envoy_dynamic_module_type_listener_filter_config_module_ptr is a pointer to an in-module listener
* OWNERSHIP: The module is responsible for managing the lifetime of the pointer. The pointer can be
* envoy_dynamic_module_type_listener_filter_module_ptr is a pointer to an in-module listener filter
* OWNERSHIP: The module is responsible for managing the lifetime of the pointer. The pointer can be
* released when envoy_dynamic_module_on_listener_filter_destroy is called for the same pointer.
* envoy_dynamic_module_callback_listener_filter_scheduler_new and the scheduling and destruction is
* done by envoy_dynamic_module_callback_listener_filter_scheduler_delete. Since its lifecycle is
* envoy_dynamic_module_type_listener_filter_config_scheduler_module_ptr is a raw pointer to the
* when scheduling the listener filter config event is done. The creation of this pointer is done by
* destruction is done by envoy_dynamic_module_callback_listener_filter_config_scheduler_delete.
* @param filter_config_envoy_ptr is the pointer to the DynamicModuleListenerFilterConfig object
* in-module listener filter configuration. Returning nullptr indicates a failure to initialize the
* envoy_dynamic_module_on_listener_filter_new is called when a new listener filter is created for
* listener filter. Returning nullptr indicates a failure to initialize the module. When it fails,
envoy_dynamic_module_type_listener_filter_module_ptr envoy_dynamic_module_on_listener_filter_new(
* envoy_dynamic_module_on_listener_filter_on_accept is called when a new connection is accepted,
* envoy_dynamic_module_on_listener_filter_on_data is called when data is available for inspection.
envoy_dynamic_module_type_on_listener_filter_status envoy_dynamic_module_on_listener_filter_on_data(
* envoy_dynamic_module_on_listener_filter_destroy is called when the listener filter is destroyed
* envoy_dynamic_module_on_listener_filter_scheduled is called when the listener filter is scheduled
* @param filter_config_envoy_ptr is the pointer to the DynamicModuleListenerFilterConfig object.
* @param filter_config_module_ptr is the pointer to the in-module listener filter config created by
* headers and body_chunks are owned by Envoy, and they are guaranteed to be valid until the end of
// Callbacks are functions implemented by Envoy that can be called by the module to interact with
* envoy_dynamic_module_callback_listener_filter_set_detected_transport_protocol is called by the
* envoy_dynamic_module_callback_listener_filter_set_requested_server_name is called by the module
* envoy_dynamic_module_callback_listener_filter_set_requested_application_protocols is called by
* `envoy_dynamic_module_callback_listener_filter_set_ja3_hash` is called by the module to set the
* `envoy_dynamic_module_callback_listener_filter_set_ja4_hash` is called by the module to set the
* envoy_dynamic_module_callback_listener_filter_get_requested_server_name is called by the module
* envoy_dynamic_module_callback_listener_filter_get_detected_transport_protocol is called by the
* module to get the detected transport protocol (e.g., "tls", "raw_buffer") from the connection
* @param result_out is the output buffer where the protocol string owned by Envoy will be stored.
* envoy_dynamic_module_callback_listener_filter_get_requested_application_protocols_size is called
* envoy_dynamic_module_callback_listener_filter_get_requested_application_protocols is called by
* module should first call get_requested_application_protocols_size to get the count and allocate
* @param protocols_out is a pre-allocated array owned by the module where Envoy will populate the
* `envoy_dynamic_module_callback_listener_filter_get_ja3_hash` is called by the module to get the
* @param result_out is the output buffer where the `JA3` hash string owned by Envoy will be stored.
* `envoy_dynamic_module_callback_listener_filter_get_ja4_hash` is called by the module to get the
* @param result_out is the output buffer where the `JA4` hash string owned by Envoy will be stored.
* envoy_dynamic_module_callback_listener_filter_get_ssl_uri_sans_size is called by the module to
* envoy_dynamic_module_callback_listener_filter_get_ssl_uri_sans is called by the module to get
* @param sans_out is a pre-allocated array owned by the module where Envoy will populate the SANs.
* The module must allocate this array with at least the size returned by get_ssl_uri_sans_size.
* envoy_dynamic_module_callback_listener_filter_get_ssl_dns_sans_size is called by the module to
* envoy_dynamic_module_callback_listener_filter_get_ssl_dns_sans is called by the module to get
* @param sans_out is a pre-allocated array owned by the module where Envoy will populate the SANs.
* The module must allocate this array with at least the size returned by get_ssl_dns_sans_size.
* envoy_dynamic_module_callback_listener_filter_get_remote_address is called by the module to get
* envoy_dynamic_module_callback_listener_filter_get_direct_remote_address is called by the module
* envoy_dynamic_module_callback_listener_filter_get_local_address is called by the module to get
* envoy_dynamic_module_callback_listener_filter_get_direct_local_address is called by the module to
* envoy_dynamic_module_callback_listener_filter_get_original_dst is called by the module to get the
* @return true if the original destination address was found and is an IP address, false otherwise.
* envoy_dynamic_module_callback_listener_filter_get_address_type is called by the module to get the
* envoy_dynamic_module_callback_listener_filter_is_local_address_restored is called by the module
* envoy_dynamic_module_callback_listener_filter_set_remote_address is called by the module to set
* envoy_dynamic_module_callback_listener_filter_restore_local_address is called by the module to
* envoy_dynamic_module_callback_listener_filter_continue_filter_chain is called by the module to
* @param success is true if the filter execution was successful, false if the connection should
* envoy_dynamic_module_callback_listener_filter_use_original_dst is called by the module to control
* envoy_dynamic_module_callback_listener_filter_write_to_socket is called by the module to write
* data directly to the raw socket. This is useful for protocol negotiation at the listener filter
* @return the number of bytes written, or -1 if the write failed or callbacks are not available.
* envoy_dynamic_module_callback_listener_filter_get_socket_fd is called by the module to get the
* envoy_dynamic_module_callback_listener_filter_set_socket_option_int sets an integer socket option
* envoy_dynamic_module_callback_listener_filter_set_socket_option_bytes sets a bytes socket option
* envoy_dynamic_module_callback_listener_filter_get_socket_option_int retrieves an integer socket
* option value from the accepted socket (@see man 2 getsockopt). This reads the actual value from
* envoy_dynamic_module_callback_listener_filter_get_socket_option_bytes retrieves a bytes socket
* option value from the accepted socket (@see man 2 getsockopt). This reads the actual value from
* @param value_out is the pointer to store the retrieved buffer. The module should pre-allocate the
envoy_dynamic_module_type_module_buffer key, envoy_dynamic_module_type_envoy_buffer* value_out);
* envoy_dynamic_module_callback_listener_filter_set_downstream_transport_failure_reason is called
* @param value_out is the pointer to write the retrieved value. If the metadata is not found or is
envoy_dynamic_module_type_module_buffer key, envoy_dynamic_module_type_envoy_buffer* value_out);
* @param counter_id_ptr where the opaque ID that represents a unique metric will be stored. This
* can be passed to envoy_dynamic_module_callback_listener_filter_increment_counter together with
* envoy_dynamic_module_callback_listener_filter_config_define_gauge is called by the module during
* envoy_dynamic_module_callback_listener_filter_set_gauge is called by the module to set the value
envoy_dynamic_module_type_metrics_result envoy_dynamic_module_callback_listener_filter_set_gauge(
* envoy_dynamic_module_callback_listener_filter_increment_gauge is called by the module to increase
* envoy_dynamic_module_callback_listener_filter_decrement_gauge is called by the module to decrease
* envoy_dynamic_module_callback_listener_filter_config_define_histogram is called by the module
* envoy_dynamic_module_callback_listener_filter_record_histogram_value is called by the module to
* envoy_dynamic_module_callback_listener_filter_http_callout is called by the module to initiate an
* HTTP callout. The callout is initiated by the listener filter and the response is received in
* @param callout_id_out is a pointer to a variable where the callout ID will be stored. This can be
* @param headers is the headers of the request. It must contain :method, :path and host headers.
envoy_dynamic_module_type_listener_filter_envoy_ptr filter_envoy_ptr, uint64_t* callout_id_out,
* envoy_dynamic_module_callback_listener_filter_scheduler_new is called by the module to create a
* new listener filter scheduler. The scheduler is used to dispatch listener filter operations from
* envoy_dynamic_module_callback_listener_filter_scheduler_delete is called by the module to delete
* envoy_dynamic_module_callback_listener_filter_config_scheduler_new is called by the module to
* create a new listener filter configuration scheduler. The scheduler is used to dispatch listener
* filter configuration operations to the main thread from any thread including the ones managed by
* @param filter_config_envoy_ptr is the pointer to the DynamicModuleListenerFilterConfig object.
* @return envoy_dynamic_module_type_listener_filter_config_scheduler_module_ptr is the pointer to
* needed. See the comment on envoy_dynamic_module_type_listener_filter_config_scheduler_module_ptr.
* envoy_dynamic_module_callback_listener_filter_config_scheduler_delete is called by the module to
* envoy_dynamic_module_callback_listener_filter_config_scheduler_commit is called by the module to
* This will eventually end up invoking envoy_dynamic_module_on_listener_filter_config_scheduled
* This can be called multiple times to schedule multiple events to the same filter configuration.
* envoy_dynamic_module_callback_listener_filter_get_worker_index is called by the module to get the
* worker index assigned to the current listener filter. This can be used by the module to manage
* envoy_dynamic_module_type_udp_listener_filter_config_module_ptr is a pointer to an in-module UDP
* envoy_dynamic_module_on_udp_listener_filter_config_new is called when a new UDP listener filter
* envoy_dynamic_module_on_udp_listener_filter_config_destroy is called when the UDP listener filter
* envoy_dynamic_module_on_udp_listener_filter_destroy is called when the UDP listener filter is
* envoy_dynamic_module_callback_udp_listener_filter_get_datagram_data_chunks_size is called by the
* envoy_dynamic_module_callback_udp_listener_filter_get_datagram_data_chunks, this can be used to
* module to get the current datagram data as chunks. The module must ensure the provided buffer
* envoy_dynamic_module_callback_udp_listener_filter_get_datagram_data_chunks_size. This is only
* envoy_dynamic_module_callback_udp_listener_filter_get_datagram_data_size is called by the module
* envoy_dynamic_module_callback_udp_listener_filter_set_datagram_data is called by the module to
* envoy_dynamic_module_callback_udp_listener_filter_get_peer_address is called by the module to
* envoy_dynamic_module_callback_udp_listener_filter_get_local_address is called by the module to
* envoy_dynamic_module_callback_udp_listener_filter_config_define_counter is called by the module
* @param config_envoy_ptr is the pointer to the DynamicModuleUdpListenerFilterConfig in which the
* @param counter_id_ptr where the opaque ID that represents a unique metric will be stored. This
* can be passed to envoy_dynamic_module_callback_udp_listener_filter_increment_counter together
* envoy_dynamic_module_callback_udp_listener_filter_increment_counter is called by the module to
* envoy_dynamic_module_callback_udp_listener_filter_config_define_gauge is called by the module
* @param config_envoy_ptr is the pointer to the DynamicModuleUdpListenerFilterConfig in which the
* envoy_dynamic_module_callback_udp_listener_filter_set_gauge is called by the module to set the
* @param config_envoy_ptr is the pointer to the DynamicModuleUdpListenerFilterConfig in which the
* envoy_dynamic_module_callback_udp_listener_filter_record_histogram_value is called by the module
* envoy_dynamic_module_callback_udp_listener_filter_get_worker_index is called by the module to get
* the worker index assigned to the current UDP listener filter. This can be used by the module to
* envoy_dynamic_module_type_access_logger_config_module_ptr is a pointer to an in-module access
* envoy_dynamic_module_type_access_logger_module_ptr is a pointer to an in-module access logger
* @param logger_envoy_ptr is the pointer to the Envoy log context (valid during this call only).
* Get the upstream TLS cipher suite. The buffer uses thread-local storage and is valid until the
* Get the upstream local certificate subject (Envoy's own certificate for the upstream connection).
* Get the downstream TLS cipher suite. The buffer uses thread-local storage and is valid until the
* Get the URI Subject Alternative Names from the downstream peer certificate. The module should
* Get the URI Subject Alternative Names from the downstream local certificate. The module should
* Get the DNS Subject Alternative Names from the downstream peer certificate. The module should
* Get the DNS Subject Alternative Names from the downstream local certificate. The module should
* @param result is the output buffer where the `JA3` hash string owned by Envoy will be stored.
* @param result is the output buffer where the `JA4` hash string owned by Envoy will be stored.
* envoy_dynamic_module_callback_access_logger_config_define_counter is called by the module during
* @param counter_id_ptr where the opaque ID that represents a unique metric will be stored. This
* envoy_dynamic_module_callback_access_logger_config_define_gauge is called by the module during
* envoy_dynamic_module_callback_access_logger_set_gauge is called by the module to set the value
envoy_dynamic_module_type_metrics_result envoy_dynamic_module_callback_access_logger_set_gauge(
* envoy_dynamic_module_callback_access_logger_increment_gauge is called by the module to increase
* envoy_dynamic_module_callback_access_logger_decrement_gauge is called by the module to decrease
* envoy_dynamic_module_callback_access_logger_record_histogram_value is called by the module to
* envoy_dynamic_module_callback_access_logger_get_worker_index is called by the module to get the
* @return the worker index assigned to the current access logger. For the main thread the index
* envoy_dynamic_module_type_bootstrap_extension_module_ptr is a pointer to an in-module bootstrap
* envoy_dynamic_module_type_bootstrap_extension_config_scheduler_module_ptr is a raw pointer to
* when scheduling the bootstrap extension config event is done. The creation of this pointer is
* done by envoy_dynamic_module_callback_bootstrap_extension_config_scheduler_new and the scheduling
* envoy_dynamic_module_callback_bootstrap_extension_config_scheduler_delete. Since its lifecycle is
* envoy_dynamic_module_type_bootstrap_extension_config_module_ptr for the given name and config.
* @param extension_config_envoy_ptr is the pointer to the DynamicModuleBootstrapExtensionConfig
* @return envoy_dynamic_module_type_bootstrap_extension_config_module_ptr is the pointer to the
* in-module bootstrap extension configuration. Returning nullptr indicates a failure to initialize
* envoy_dynamic_module_on_bootstrap_extension_config_destroy is called when the bootstrap extension
* configuration is destroyed in Envoy. The module should release any resources associated with the
* @param extension_config_ptr is the pointer to the in-module bootstrap extension configuration
* @param extension_config_ptr is the pointer to the in-module bootstrap extension configuration.
* @param extension_envoy_ptr is the pointer to the DynamicModuleBootstrapExtension object of the
* @return envoy_dynamic_module_type_bootstrap_extension_module_ptr is the pointer to the in-module
* envoy_dynamic_module_on_bootstrap_extension_worker_thread_initialized is called when a worker
* envoy_dynamic_module_on_bootstrap_extension_drain_started is called when Envoy begins draining.
* when it has finished its asynchronous work. Envoy will wait for the callback before proceeding.
* @param context is the opaque context pointer that was passed alongside this callback. The module
* cleanup. Envoy will wait for the callback before terminating. This is the appropriate place to
* flush batched data, close connections, or signal external systems that this Envoy instance is
* @param completion_callback is the callback that must be invoked when shutdown cleanup is done.
* envoy_dynamic_module_on_bootstrap_extension_destroy is called when the bootstrap extension is
* @param extension_config_envoy_ptr is the pointer to the DynamicModuleBootstrapExtensionConfig
* @param extension_config_ptr is the pointer to the in-module bootstrap extension configuration
* @param extension_config_envoy_ptr is the pointer to the DynamicModuleBootstrapExtensionConfig
* envoy_dynamic_module_on_bootstrap_extension_cluster_add_or_update is called when a cluster is
* @param extension_config_envoy_ptr is the pointer to the DynamicModuleBootstrapExtensionConfig
* @param extension_config_envoy_ptr is the pointer to the DynamicModuleBootstrapExtensionConfig
* envoy_dynamic_module_on_bootstrap_extension_listener_add_or_update is called when a listener is
* @param extension_config_envoy_ptr is the pointer to the DynamicModuleBootstrapExtensionConfig
* @param extension_config_envoy_ptr is the pointer to the DynamicModuleBootstrapExtensionConfig
* envoy_dynamic_module_callback_bootstrap_extension_config_scheduler_new is called by the module
* to create a new bootstrap extension configuration scheduler. The scheduler is used to dispatch
* bootstrap extension configuration operations to the main thread from any thread including the
* @param extension_config_envoy_ptr is the pointer to the DynamicModuleBootstrapExtensionConfig
* @return envoy_dynamic_module_type_bootstrap_extension_config_scheduler_module_ptr is the pointer
* envoy_dynamic_module_callback_bootstrap_extension_config_scheduler_delete when it is no longer
* @param scheduler_module_ptr is the pointer to the bootstrap extension configuration scheduler
envoy_dynamic_module_type_bootstrap_extension_config_scheduler_module_ptr scheduler_module_ptr);
* module to schedule a generic event to the bootstrap extension configuration on the main thread.
* This will eventually end up invoking envoy_dynamic_module_on_bootstrap_extension_config_scheduled
* @param scheduler_module_ptr is the pointer to the bootstrap extension configuration scheduler
envoy_dynamic_module_type_bootstrap_extension_config_scheduler_module_ptr scheduler_module_ptr,
* envoy_dynamic_module_on_bootstrap_extension_http_callout_done is called when the HTTP callout
* @param extension_config_envoy_ptr is the pointer to the DynamicModuleBootstrapExtensionConfig
* headers and body_chunks are owned by Envoy, and they are guaranteed to be valid until the end of
* initiate an HTTP callout. The callout is initiated by the bootstrap extension and the response
* This must be called on the main thread. To call from other threads, use the scheduler mechanism
* @param extension_config_envoy_ptr is the pointer to the DynamicModuleBootstrapExtensionConfig
* @param callout_id_out is a pointer to a variable where the callout ID will be stored. This can be
* @param headers is the headers of the request. It must contain :method, :path and host headers.
* envoy_dynamic_module_callback_bootstrap_extension_config_signal_init_complete is called by the
* envoy_dynamic_module_on_bootstrap_extension_config_new to unblock Envoy. If the module does not
* This must be called on the main thread. To call from other threads, use the scheduler mechanism
* @param extension_config_envoy_ptr is the pointer to the DynamicModuleBootstrapExtensionConfig
* envoy_dynamic_module_callback_bootstrap_extension_get_counter_value is called by the module to
* envoy_dynamic_module_callback_bootstrap_extension_get_histogram_summary is called by the module
* @return true if the histogram was found and the output pointers were populated, false otherwise.
* envoy_dynamic_module_callback_bootstrap_extension_iterate_counters is called by the module to
// -------------------- Bootstrap Extension Callbacks - Metrics Define/Update --------------------
* envoy_dynamic_module_callback_bootstrap_extension_config_define_counter is called by the module
* during initialization to create a template for generating Stats::Counters with the given name and
* @param config_envoy_ptr is the pointer to the DynamicModuleBootstrapExtensionConfig in which the
* @param counter_id_ptr where the opaque ID that represents a unique metric will be stored. This
* envoy_dynamic_module_callback_bootstrap_extension_config_define_gauge is called by the module
* during initialization to create a template for generating Stats::Gauges with the given name and
* @param config_envoy_ptr is the pointer to the DynamicModuleBootstrapExtensionConfig in which the
* @param gauge_id_ptr where the opaque ID that represents a unique metric will be stored. This can
* be passed to envoy_dynamic_module_callback_bootstrap_extension_config_increment_gauge together
* envoy_dynamic_module_callback_bootstrap_extension_config_set_gauge is called by the module to
* envoy_dynamic_module_callback_bootstrap_extension_config_increment_gauge is called by the module
* envoy_dynamic_module_callback_bootstrap_extension_config_decrement_gauge is called by the module
* module during initialization to create a template for generating Stats::Histograms with the given
* @param config_envoy_ptr is the pointer to the DynamicModuleBootstrapExtensionConfig in which the
* envoy_dynamic_module_callback_bootstrap_extension_config_record_histogram_value is called by the
* envoy_dynamic_module_callback_bootstrap_extension_timer_new is called by the module to create a
* new timer on the main thread dispatcher. The timer is not enabled upon creation; the module must
* When the timer fires, envoy_dynamic_module_on_bootstrap_extension_timer_fired is called on the
* @param extension_config_envoy_ptr is the pointer to the DynamicModuleBootstrapExtensionConfig
* envoy_dynamic_module_callback_bootstrap_extension_timer_enable is called by the module to enable
* the timer with a given delay. If the timer is already enabled, it will be reset to the new delay.
* envoy_dynamic_module_callback_bootstrap_extension_timer_enabled is called by the module to check
* envoy_dynamic_module_callback_bootstrap_extension_timer_delete is called by the module to delete
* @param extension_config_envoy_ptr is the pointer to the DynamicModuleBootstrapExtensionConfig
* @param extension_config_envoy_ptr is the pointer to the DynamicModuleBootstrapExtensionConfig
* @param extension_config_envoy_ptr is the pointer to the DynamicModuleBootstrapExtensionConfig
* @param extension_config_envoy_ptr is the pointer to the DynamicModuleBootstrapExtensionConfig
* @param extension_config_envoy_ptr is the pointer to the DynamicModuleBootstrapExtensionConfig
* @return true if the cluster lifecycle callbacks were successfully registered, false otherwise.
// -------------------- Bootstrap Extension Callbacks - Listener Lifecycle --------------------
* @param extension_config_envoy_ptr is the pointer to the DynamicModuleBootstrapExtensionConfig
* @return true if the listener lifecycle callbacks were successfully registered, false otherwise.
* envoy_dynamic_module_type_cluster_config_envoy_ptr is a raw pointer to the cluster configuration
* This has 1:1 correspondence with envoy_dynamic_module_type_cluster_config_envoy_ptr in Envoy.
* OWNERSHIP: The module is responsible for managing the lifetime of the pointer. The pointer can
* be released when envoy_dynamic_module_on_cluster_config_destroy is called for the same pointer.
* envoy_dynamic_module_type_cluster_envoy_ptr is a raw pointer to the DynamicModuleCluster class
* in Envoy. This is passed to the module when creating a new cluster and used to access cluster
* OWNERSHIP: The module is responsible for managing the lifetime of the pointer. The pointer can
* envoy_dynamic_module_type_cluster_lb_envoy_ptr is a raw pointer to the load balancer instance
* This has 1:1 correspondence with envoy_dynamic_module_type_cluster_lb_module_ptr in the module.
* OWNERSHIP: The module is responsible for managing the lifetime of the pointer. The pointer can
* envoy_dynamic_module_type_cluster_host_envoy_ptr is a pointer to a Host in Envoy's cluster. This
* OWNERSHIP: Envoy owns the pointer. The pointer remains valid as long as the host is part of the
* envoy_dynamic_module_type_cluster_lb_context_envoy_ptr is a pointer to the LoadBalancerContext in
* Envoy. This provides per-request information for load balancing decisions such as hash keys and
* envoy_dynamic_module_on_cluster_lb_choose_host call, unless async host selection is used. When
* async host selection is used, the context remains valid until the async completion callback is
* DynamicModuleClusterScheduler class in Envoy. This is used to schedule events to the main thread
* envoy_dynamic_module_callback_cluster_scheduler_new and the scheduling and destruction is done by
* envoy_dynamic_module_callback_cluster_scheduler_delete. Since its lifecycle is owned/managed by
* envoy_dynamic_module_type_cluster_lb_async_handle_module_ptr is a pointer to an in-module async
* configuration referencing this module is loaded. The module should parse the configuration and
envoy_dynamic_module_type_cluster_config_module_ptr envoy_dynamic_module_on_cluster_config_new(
* @return envoy_dynamic_module_type_cluster_module_ptr is the pointer to the in-module cluster.
* envoy_dynamic_module_on_cluster_init is called when cluster initialization begins. The module
* envoy_dynamic_module_callback_cluster_pre_init_complete when the initial set of hosts is ready.
* envoy_dynamic_module_on_cluster_lb_new is called when a new load balancer instance is created
* 1. Synchronous success: Set ``*host_out`` to a valid host pointer and ``*async_handle_out`` to
* 3. Async pending: Set ``*host_out`` to nullptr and ``*async_handle_out`` to a valid in-module
* envoy_dynamic_module_callback_cluster_lb_async_host_selection_complete to deliver the result,
* envoy_dynamic_module_on_cluster_lb_cancel_host_selection is called when the stream is destroyed
* before async host selection completes (e.g., stream timeout). After this call, the module must
* not call envoy_dynamic_module_callback_cluster_lb_async_host_selection_complete for this handle.
* @param async_handle_module_ptr is the in-module async handle that was previously returned from
* envoy_dynamic_module_on_cluster_scheduled is called on the main thread when an event previously
* scheduled via envoy_dynamic_module_callback_cluster_scheduler_commit is dispatched. The module
* envoy_dynamic_module_on_cluster_server_initialized is called when the server initialization is
* This is the appropriate place to start background discovery tasks or establish connections that
* This is called on the main thread before workers are stopped. The module can still use cluster
* cleanup. Envoy will wait for the callback before terminating. This is the appropriate place to
* @param completion_callback is the callback that must be invoked when shutdown cleanup is done.
* callout initiated by envoy_dynamic_module_callback_cluster_http_callout receives a response or
* @param regions is the array of locality region strings for each host. Each entry is owned by the
* @param sub_zones is the array of locality sub-zone strings for each host. Each entry is owned by
* ``envoy_dynamic_module_type_module_buffer`` entries. All metadata values are stored as string
* @param metadata_pairs_per_host is the number of (filter_name, key, value) triples per host. Must
* @param result_host_ptrs is the output array of host pointers. On success, each entry is set to
* the corresponding created host pointer. On failure, the array contents are undefined. The array
* envoy_dynamic_module_callback_cluster_remove_hosts removes multiple hosts from the cluster in a
* single batch operation. This triggers only one priority set update regardless of how many hosts
* @return the number of hosts that were successfully removed. Hosts not found in the cluster are
* envoy_dynamic_module_callback_cluster_update_host_health updates the health status of a host in
* the cluster. This allows the module to mark hosts as unhealthy, degraded, or healthy based on
* @return true if the host was found and updated, false if the host pointer is not in the cluster.
* envoy_dynamic_module_callback_cluster_find_host_by_address looks up a host by its address string
* across all priorities in the cluster and returns the host pointer. This provides O(1) lookup by
* This is optional. Only modules that need to resolve addresses to host pointers need to use this.
* envoy_dynamic_module_callback_cluster_pre_init_complete signals that the cluster's initial host
* envoy_dynamic_module_on_cluster_init to allow Envoy to start routing traffic to this cluster.
* envoy_dynamic_module_callback_cluster_lb_get_healthy_host_count returns the number of healthy
* envoy_dynamic_module_callback_cluster_lb_get_degraded_hosts_count returns the number of degraded
* envoy_dynamic_module_callback_cluster_lb_get_priority_set_size returns the number of priority
* envoy_dynamic_module_callback_cluster_lb_get_healthy_host_address returns the address of a host
envoy_dynamic_module_type_host_health envoy_dynamic_module_callback_cluster_lb_get_host_health(
* address string across all priorities and returns the health status. This uses the cross-priority
envoy_dynamic_module_type_module_buffer address, envoy_dynamic_module_type_host_health* result);
* string across all priorities in the cluster's priority set and returns the host pointer. This
* This is optional. Only modules that need access to all hosts regardless of health status need
envoy_dynamic_module_type_cluster_host_envoy_ptr envoy_dynamic_module_callback_cluster_lb_get_host(
* envoy_dynamic_module_callback_cluster_lb_set_host_data stores a module-defined opaque value on a
* host identified by priority and index within all hosts. This data is stored per load balancer
* instance (i.e., per worker thread) and can be used to attach per-host state for load balancing
* The data is only valid for the lifetime of the load balancer instance. It is not shared across
* worker threads. Callers are responsible for managing the memory pointed to by the stored value
* envoy_dynamic_module_callback_cluster_lb_get_host_data retrieves a module-defined opaque value
* envoy_dynamic_module_callback_cluster_lb_get_host_metadata_string is called by the module to get
* envoy_dynamic_module_callback_cluster_lb_get_host_metadata_number is called by the module to get
* envoy_dynamic_module_callback_cluster_lb_get_host_metadata_bool is called by the module to get
* buckets for the healthy hosts at a given priority. Each bucket groups hosts that share the same
* envoy_dynamic_module_callback_cluster_lb_get_locality_host_count returns the number of healthy
* envoy_dynamic_module_callback_cluster_lb_get_locality_host_address returns the address of a host
* envoy_dynamic_module_callback_cluster_lb_get_locality_weight returns the weight of a locality
* @return the weight of the locality, or 0 if the index is out of bounds or weights are not set.
* cluster. The scheduler allows the module to dispatch events to the main thread from any thread.
* @return envoy_dynamic_module_type_cluster_scheduler_module_ptr is the pointer to the scheduler.
* envoy_dynamic_module_callback_cluster_scheduler_delete deletes a scheduler previously created by
* envoy_dynamic_module_callback_cluster_scheduler_new. After this call, the scheduler pointer is
* envoy_dynamic_module_callback_cluster_scheduler_commit schedules an event to be dispatched on
* the main thread. When the event is dispatched, envoy_dynamic_module_on_cluster_scheduled will be
envoy_dynamic_module_type_cluster_scheduler_module_ptr scheduler_module_ptr, uint64_t event_id);
* @param cluster_config_envoy_ptr is the pointer to the DynamicModuleClusterConfig in which the
* @param counter_id_ptr where the opaque ID that represents a unique metric will be stored. This
* can be passed to envoy_dynamic_module_callback_cluster_config_increment_counter together with
* @param cluster_config_envoy_ptr is the pointer to the DynamicModuleClusterConfig in which the
envoy_dynamic_module_type_metrics_result envoy_dynamic_module_callback_cluster_config_define_gauge(
* envoy_dynamic_module_callback_cluster_config_set_gauge is called by the module to set the value
envoy_dynamic_module_type_metrics_result envoy_dynamic_module_callback_cluster_config_set_gauge(
* @param cluster_config_envoy_ptr is the pointer to the DynamicModuleClusterConfig in which the
* envoy_dynamic_module_callback_cluster_config_record_histogram_value is called by the module to
* envoy_dynamic_module_callback_cluster_lb_context_compute_hash_key computes a hash key from the
* envoy_dynamic_module_callback_cluster_lb_context_get_downstream_headers_size returns the number
* envoy_dynamic_module_callback_cluster_lb_context_get_downstream_headers retrieves all downstream
* @param result_headers is the output array of header key-value pairs. Must be pre-allocated with
* @return true if the headers were retrieved, false if the context is nullptr or no headers are
* Since a header key can have multiple values, the ``index`` parameter selects a specific value.
* The ``optional_size`` parameter can be used to retrieve the total number of values for the key.
* @param result_buffer is the output buffer for the header value. Owned by Envoy and valid only
* @param optional_size is an optional output for the total number of values for this key. Can be
* envoy_dynamic_module_callback_cluster_lb_context_should_select_another_host checks whether the
* load balancer should reject the given host and retry selection. This is used during retries to
* address and strict mode flag from the context. Override host allows upstream filters to direct
* @param address is the output buffer for the override host address. Owned by Envoy and valid only
* envoy_dynamic_module_callback_cluster_lb_async_host_selection_complete is called by the module
* to deliver the result of an asynchronous host selection. This must be called exactly once for
* After calling this, the module must not use the ``lb_envoy_ptr`` for this async operation again.
* @param lb_envoy_ptr is the pointer to the Envoy-side load balancer. The module receives this as
* @param details is a description of the resolution outcome (e.g., error reason). Can be empty.
* envoy_dynamic_module_callback_cluster_http_callout sends an HTTP request to the specified cluster
* and asynchronously delivers the response via envoy_dynamic_module_on_cluster_http_callout_done.
* @param callout_id_out is a pointer to a variable where the callout ID will be stored on success.
* envoy_dynamic_module_callback_cluster_lb_get_member_update_host_address to get the addresses of
* After this callback returns, the module can use the standard host query callbacks to inspect the
* structures (e.g., hash rings, address-to-index maps) when the host set changes need to implement
* envoy_dynamic_module_callback_cluster_lb_get_member_update_host_address returns the address of
* @param result is the output buffer for the host address string. The buffer points to Envoy-owned
* OWNERSHIP: The module is responsible for managing the lifetime of the pointer. The pointer can
* OWNERSHIP: The module is responsible for managing the lifetime of the pointer. The pointer can
* the in-module configuration. Returning nullptr indicates a failure and the configuration will
envoy_dynamic_module_on_lb_new(envoy_dynamic_module_type_lb_config_module_ptr config_module_ptr,
void envoy_dynamic_module_on_lb_destroy(envoy_dynamic_module_type_lb_module_ptr lb_module_ptr);
* envoy_dynamic_module_callback_lb_get_degraded_hosts_count returns the number of degraded hosts
* string across all priorities and returns the health status. This uses the cross-priority host
* The address string must match the format returned by host->address()->asStringView(), which is
envoy_dynamic_module_type_module_buffer address, envoy_dynamic_module_type_host_health* result);
* envoy_dynamic_module_callback_lb_set_host_data stores a module-defined opaque value on a host
* identified by priority and index within all hosts. This data is stored per load balancer instance
* (i.e., per worker thread) and can be used to attach per-host state for load balancing decisions
* The data is only valid for the lifetime of the load balancer instance. It is not shared across
* worker threads. Callers are responsible for managing the memory pointed to by the stored value
* for the healthy hosts at a given priority. Each bucket groups hosts that share the same locality.
envoy_dynamic_module_type_lb_envoy_ptr lb_envoy_ptr, uint32_t priority, size_t locality_index);
* @return the weight of the locality, or 0 if the index is out of bounds or weights are not set.
envoy_dynamic_module_type_lb_envoy_ptr lb_envoy_ptr, uint32_t priority, size_t locality_index);
* envoy_dynamic_module_callback_lb_context_get_downstream_headers is called by the module to get
* PRECONDITION: The module must ensure that the result_headers is valid and has enough length to
* @param result_headers is the pointer to the array of envoy_dynamic_module_type_envoy_http_header
* where the headers will be stored. The lifetime of the buffer of key and value of each header is
* envoy_dynamic_module_callback_lb_context_get_downstream_header is called by the module to get
* the value of the downstream request header with the given key. Since a header can have multiple
* values, the index is used to get the specific value. This returns the number of values for the
* given key via optional_size, so it can be used to iterate over all values by starting from 0 and
* @param result_buffer is the buffer where the value will be stored. If the key does not exist or
* @param optional_size is the pointer to the variable where the number of values for the given key
* NOTE: This parameter is optional and can be null if the module does not need this information.
* and strict mode flag from the load balancer context. Override host allows upstream filters to
* @param address is the output buffer for the override host address string. The buffer points to
* envoy_dynamic_module_callback_lb_get_member_update_host_address returns the address of an added
* @param result is the output buffer for the host address string. The buffer points to Envoy-owned
envoy_dynamic_module_callback_lb_get_host_stat(envoy_dynamic_module_type_lb_envoy_ptr lb_envoy_ptr,
* @param counter_id_ptr where the opaque ID that represents a unique metric will be stored. This
envoy_dynamic_module_type_metrics_result envoy_dynamic_module_callback_lb_config_define_counter(
* envoy_dynamic_module_callback_lb_config_increment_counter is called by the module to increment
envoy_dynamic_module_type_metrics_result envoy_dynamic_module_callback_lb_config_increment_counter(
* initialization to create a template for generating Stats::Gauges with the given name and labels
* @param gauge_id_ptr where the opaque ID that represents a unique metric will be stored. This can
envoy_dynamic_module_type_metrics_result envoy_dynamic_module_callback_lb_config_define_gauge(
* envoy_dynamic_module_callback_lb_config_set_gauge is called by the module to set the value of a
* envoy_dynamic_module_callback_lb_config_increment_gauge is called by the module to increase the
envoy_dynamic_module_type_metrics_result envoy_dynamic_module_callback_lb_config_increment_gauge(
* envoy_dynamic_module_callback_lb_config_decrement_gauge is called by the module to decrease the
envoy_dynamic_module_type_metrics_result envoy_dynamic_module_callback_lb_config_decrement_gauge(
* initialization to create a template for generating Stats::Histograms with the given name and
* @param lb_config_envoy_ptr is the pointer to the DynamicModuleLbConfig in which the histogram
* This can be passed to envoy_dynamic_module_callback_lb_config_record_histogram_value together
envoy_dynamic_module_type_metrics_result envoy_dynamic_module_callback_lb_config_define_histogram(
* envoy_dynamic_module_callback_lb_config_record_histogram_value is called by the module to record
* envoy_dynamic_module_type_matcher_input_envoy_ptr is a raw pointer to the matcher input in Envoy.
envoy_dynamic_module_type_matcher_config_module_ptr envoy_dynamic_module_on_matcher_config_new(
* DynamicModuleCertValidatorConfig object in Envoy. This is passed to the module during config
* envoy_dynamic_module_type_cert_validator_config_module_ptr is a pointer to the in-module cert
* envoy_dynamic_module_type_cert_validator_client_validation_status represents the detailed client
* envoy_dynamic_module_type_cert_validator_validation_result is the result of a certificate chain
* verification. Returned by the envoy_dynamic_module_on_cert_validator_do_verify_cert_chain event
* envoy_dynamic_module_on_cert_validator_config_new is called by the main thread when the cert
* @param config_envoy_ptr is the pointer to the DynamicModuleCertValidatorConfig object for the
* in-module cert validator configuration. Returning nullptr indicates a failure to initialize the
* configuration is destroyed in Envoy. The module should release any resources associated with
* envoy_dynamic_module_on_cert_validator_do_verify_cert_chain is called to verify a certificate
* chain during a TLS handshake. The certificates are provided as DER-encoded buffers. The first
* The certs array and its buffer contents are owned by Envoy and are valid only for the duration
* @return envoy_dynamic_module_type_cert_validator_validation_result is the validation result.
* @param handshaker_provides_certificates is true if the handshaker provides certificates itself.
* context hash. The module should provide bytes that uniquely identify its validation configuration
* so that configuration changes invalidate existing TLS sessions. The output buffer must remain
* envoy_dynamic_module_callback_cert_validator_set_error_details is called by the module during
* envoy_dynamic_module_on_cert_validator_do_verify_cert_chain to set error details for a failed
* validation. Envoy copies the provided buffer immediately, so the module does not need to keep
envoy_dynamic_module_type_module_buffer key, envoy_dynamic_module_type_envoy_buffer* value_out);
* envoy_dynamic_module_on_upstream_http_tcp_bridge_config_new is called by the main thread when
* envoy_dynamic_module_type_upstream_http_tcp_bridge_config_module_ptr for given name and config.
* @param config_envoy_ptr is the pointer to the BridgeConfig object for the corresponding config.
* @return envoy_dynamic_module_type_upstream_http_tcp_bridge_config_module_ptr is the pointer to
* configuration is destroyed in Envoy. The module should release any resources associated with
* @param config_module_ptr is a pointer to the in-module bridge configuration whose corresponding
* envoy_dynamic_module_on_upstream_http_tcp_bridge_new is called when a new per-request bridge
* instance is created. This happens for each HTTP request that is routed to a cluster configured
* envoy_dynamic_module_on_upstream_http_tcp_bridge_encode_headers is called when the HTTP request
* envoy_dynamic_module_on_upstream_http_tcp_bridge_encode_data is called when the HTTP request
* body data is being encoded for the upstream. The module can read the current request body data
* envoy_dynamic_module_on_upstream_http_tcp_bridge_encode_trailers is called when the HTTP request
* trailers are being encoded for the upstream. The module can use send_upstream_data to forward
* envoy_dynamic_module_on_upstream_http_tcp_bridge_on_upstream_data is called when raw TCP data
* envoy_dynamic_module_on_upstream_http_tcp_bridge_destroy is called when the per-request bridge
* envoy_dynamic_module_callback_upstream_http_tcp_bridge_get_request_headers_size is called by
* module to get the current request body data as a series of buffer slices. During encode_data,
* envoy_dynamic_module_callback_upstream_http_tcp_bridge_send_response is called by the module
* to send a complete local response to the downstream client, ending the stream. This is useful
* envoy_dynamic_module_callback_upstream_http_tcp_bridge_send_response_headers is called by the
* envoy_dynamic_module_callback_upstream_http_tcp_bridge_send_response_trailers is called by the