Skip to content

Commit c588e55

Browse files
committed
revert
Signed-off-by: Gal Ovadia <ggalovadia@gmail.com>
1 parent 87b0050 commit c588e55

File tree

3 files changed

+4
-58
lines changed

3 files changed

+4
-58
lines changed

rust/Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

rust/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ repository = "https://github.com/envoyproxy/dynamic-modules-example"
77

88
[dependencies]
99
# The SDK version must match the Envoy version due to the strict compatibility requirements.
10-
envoy-proxy-dynamic-modules-rust-sdk = { git = "https://github.com/envoyproxy/envoy", rev = "f0e51db62b58196f012f93f20899d86ec81c63e6" }
10+
envoy-proxy-dynamic-modules-rust-sdk = { git = "https://github.com/envoyproxy/envoy", rev = "6d9bb7d9a85d616b220d1f8fe67b61f82bbdb8d3" }
1111
serde = { version = "1.0", features = ["derive"] }
1212
serde_json = "1.0"
1313
rand = "0.9.0"

rust/src/lib.rs

Lines changed: 2 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -60,15 +60,7 @@ pub mod listener_ip_allowlist;
6060
pub mod listener_sni_router;
6161
pub 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

Comments
 (0)