@@ -60,15 +60,7 @@ pub mod listener_ip_allowlist;
6060pub mod listener_sni_router;
6161pub mod listener_tls_detector;
6262
63- // DNS gateway module example.
64- pub mod dns_gateway;
65-
66- declare_all_init_functions ! (
67- init,
68- http: new_http_filter_config_fn,
69- network: new_network_filter_config_fn,
70- udp_listener: new_udp_listener_filter_config_fn,
71- ) ;
63+ declare_init_functions ! ( init, new_http_filter_config_fn) ;
7264
7365/// This implements the [`envoy_proxy_dynamic_modules_rust_sdk::ProgramInitFunction`].
7466///
@@ -107,52 +99,6 @@ fn new_http_filter_config_fn<EC: EnvoyHttpFilterConfig, EHF: EnvoyHttpFilter>(
10799 . map ( |config| Box :: new ( config) as Box < dyn HttpFilterConfig < EHF > > ) ,
108100 "metrics" => http_metrics:: FilterConfig :: new ( filter_config, envoy_filter_config)
109101 . map ( |config| Box :: new ( config) as Box < dyn HttpFilterConfig < EHF > > ) ,
110- _ => panic ! ( "Unknown HTTP filter name: {filter_name}" ) ,
111- }
112- }
113-
114- /// This implements the [`envoy_proxy_dynamic_modules_rust_sdk::NewNetworkFilterConfigFunction`].
115- ///
116- /// This is the entrypoint every time a new Network filter is created via the DynamicModuleNetworkFilter config.
117- ///
118- /// Each argument matches the corresponding argument in the Envoy config here:
119- /// https://www.envoyproxy.io/docs/envoy/latest/api-v3/extensions/dynamic_modules/v3/dynamic_modules.proto#envoy-v3-api-msg-extensions-dynamic-modules-v3-dynamicmoduleconfig
120- ///
121- /// Returns None if the filter name or config is determined to be invalid by each filter's `new` function.
122- fn new_network_filter_config_fn < EC : EnvoyNetworkFilterConfig , ENF : EnvoyNetworkFilter > (
123- _envoy_filter_config : & mut EC ,
124- filter_name : & str ,
125- filter_config : & [ u8 ] ,
126- ) -> Option < Box < dyn NetworkFilterConfig < ENF > > > {
127- match filter_name {
128- "cache_lookup" => Some (
129- Box :: new ( dns_gateway:: cache_lookup:: CacheLookupFilterConfig :: new (
130- filter_config,
131- ) ) as Box < dyn NetworkFilterConfig < ENF > > ,
132- ) ,
133- _ => panic ! ( "Unknown network filter name: {filter_name}" ) ,
134- }
135- }
136-
137- /// This implements the [`envoy_proxy_dynamic_modules_rust_sdk::NewUdpListenerFilterConfigFunction`].
138- ///
139- /// This is the entrypoint every time a new UDP Listener filter is created via the DynamicModuleUdpListenerFilter config.
140- ///
141- /// Each argument matches the corresponding argument in the Envoy config here:
142- /// https://www.envoyproxy.io/docs/envoy/latest/api-v3/extensions/dynamic_modules/v3/dynamic_modules.proto#envoy-v3-api-msg-extensions-dynamic-modules-v3-dynamicmoduleconfig
143- ///
144- /// Returns None if the filter name or config is determined to be invalid by each filter's `new` function.
145- fn new_udp_listener_filter_config_fn <
146- EC : EnvoyUdpListenerFilterConfig ,
147- ELF : EnvoyUdpListenerFilter ,
148- > (
149- _envoy_filter_config : & mut EC ,
150- filter_name : & str ,
151- filter_config : & [ u8 ] ,
152- ) -> Option < Box < dyn UdpListenerFilterConfig < ELF > > > {
153- match filter_name {
154- "dns_gateway" => dns_gateway:: DnsGatewayFilterConfig :: new ( filter_config)
155- . map ( |config| Box :: new ( config) as Box < dyn UdpListenerFilterConfig < ELF > > ) ,
156- _ => panic ! ( "Unknown UDP listener filter name: {filter_name}" ) ,
102+ _ => panic ! ( "Unknown filter name: {filter_name}" ) ,
157103 }
158104}
0 commit comments