@@ -64,19 +64,21 @@ pub mod listener_tls_detector;
6464// Implements a system for defining egress policies by hostname.
6565pub mod egress_policies;
6666
67- // Register all filters
68- // This is a temporary workaround until https://github.com/envoyproxy/envoy/pull/43402 is merged
69- #[ no_mangle]
70- pub extern "C" fn envoy_dynamic_module_on_program_init ( ) -> * const std:: os:: raw:: c_char {
71- envoy_proxy_dynamic_modules_rust_sdk:: NEW_HTTP_FILTER_CONFIG_FUNCTION
72- . get_or_init ( || new_http_filter_config_fn) ;
73- envoy_proxy_dynamic_modules_rust_sdk:: NEW_NETWORK_FILTER_CONFIG_FUNCTION
74- . get_or_init ( || new_network_filter_config_fn) ;
75- envoy_proxy_dynamic_modules_rust_sdk:: NEW_UDP_LISTENER_FILTER_CONFIG_FUNCTION
76- . get_or_init ( || new_udp_listener_filter_config_fn) ;
77- abi:: kAbiVersion. as_ptr ( ) as * const std:: os:: raw:: c_char
67+ // Program initialization function called before any filters are created.
68+ // Return true to indicate successful initialization, false to fail module loading.
69+ fn program_init ( ) -> bool {
70+ envoy_log_info ! ( "Rust dynamic module initialized" ) ;
71+ true
7872}
7973
74+ // Register all filter types
75+ declare_all_init_functions ! (
76+ program_init,
77+ http: new_http_filter_config_fn,
78+ network: new_network_filter_config_fn,
79+ udp_listener: new_udp_listener_filter_config_fn,
80+ ) ;
81+
8082/// This implements the [`envoy_proxy_dynamic_modules_rust_sdk::NewHttpFilterConfigFunction`].
8183///
8284/// This is the entrypoint every time a new HTTP filter is created via the DynamicModuleFilter config.
0 commit comments