vane 0.9.0

A flow-based reverse proxy with multi-layer routing and programmable pipelines.
/* src/layers/l4/loader.rs */

pub use crate::common::config::loader::{PreProcess, load_config, load_file};

use super::{tcp::TcpConfig, udp::UdpConfig};

// Implement PreProcess for the new enum. It only applies to the legacy variant.
impl PreProcess for TcpConfig {
	fn pre_process(&mut self) {
		if let Self::Legacy(config) = self {
			for rule in &mut config.rules {
				rule.name = rule.name.to_lowercase();
			}
		}
	}
}

impl PreProcess for UdpConfig {
	fn pre_process(&mut self) {
		if let Self::Legacy(config) = self {
			for rule in &mut config.rules {
				rule.name = rule.name.to_lowercase();
			}
		}
	}
}