@@ -18,6 +18,7 @@ pub enum ConfigError {
1818}
1919
2020#[ derive( Debug , Deserialize ) ]
21+ #[ allow( dead_code) ] // Config fields loaded from TOML
2122pub struct Config {
2223 pub source : Option < SourceConfig > ,
2324 pub dest : Option < DestConfig > ,
@@ -28,6 +29,7 @@ pub struct Config {
2829}
2930
3031#[ derive( Debug , Clone , Deserialize ) ]
32+ #[ allow( dead_code) ] // Config fields loaded from TOML
3133pub struct SourceConfig {
3234 #[ serde( default = "default_listen_ip" ) ]
3335 pub listen_ip : String ,
@@ -76,6 +78,17 @@ pub struct SourceConfig {
7678 #[ serde( default = "default_frame_buffer_size" ) ]
7779 pub frame_buffer_size : usize ,
7880
81+ // Channel configuration
82+ #[ serde( default = "default_connection_channel_size" ) ]
83+ pub connection_channel_size : usize ,
84+
85+ // Circuit breaker configuration
86+ #[ serde( default = "default_circuit_breaker_window_secs" ) ]
87+ pub circuit_breaker_window_secs : u64 ,
88+
89+ #[ serde( default = "default_circuit_breaker_max_restarts" ) ]
90+ pub circuit_breaker_max_restarts : usize ,
91+
7992 #[ serde( default ) ]
8093 pub allowed_outbound : AllowedOutboundConfig ,
8194
@@ -92,6 +105,7 @@ pub struct SourceConfig {
92105}
93106
94107#[ derive( Debug , Clone , Deserialize ) ]
108+ #[ allow( dead_code) ] // Config fields loaded from TOML
95109pub struct DestConfig {
96110 #[ serde( default = "default_listen_ip" ) ]
97111 pub listen_ip : String ,
@@ -109,6 +123,10 @@ pub struct DestConfig {
109123 #[ serde( default = "default_target_timeout" ) ]
110124 pub target_connect_timeout_ms : u64 ,
111125
126+ // Channel configuration
127+ #[ serde( default = "default_connection_channel_size" ) ]
128+ pub connection_channel_size : usize ,
129+
112130 #[ serde( default ) ]
113131 pub connection_filter : ConnectionFilterConfig ,
114132
@@ -122,6 +140,7 @@ pub struct DestConfig {
122140}
123141
124142#[ derive( Debug , Deserialize ) ]
143+ #[ allow( dead_code) ] // Config fields loaded from TOML
125144pub struct AuthConfig {
126145 #[ serde( default = "default_mtls" ) ]
127146 pub use_mtls : bool ,
@@ -139,6 +158,7 @@ pub struct AuthConfig {
139158}
140159
141160#[ derive( Debug , Deserialize ) ]
161+ #[ allow( dead_code) ] // Config fields loaded from TOML
142162pub struct CryptoConfig {
143163 #[ serde( default = "default_kem_mode" ) ]
144164 pub kem_mode : KemMode ,
@@ -220,6 +240,7 @@ pub struct ExposedPortConfig {
220240}
221241
222242#[ derive( Debug , Clone , Deserialize ) ]
243+ #[ allow( dead_code) ] // Config fields loaded from TOML
223244pub struct ServiceConfig {
224245 pub name : String ,
225246 pub port : u16 ,
@@ -231,6 +252,7 @@ pub struct ServiceConfig {
231252}
232253
233254impl ServiceConfig {
255+ #[ allow( dead_code) ] // Public API method
234256 pub fn get_protocol ( & self ) -> crate :: tunnel:: Protocol {
235257 match self . protocol . to_lowercase ( ) . as_str ( ) {
236258 "udp" => crate :: tunnel:: Protocol :: Udp ,
@@ -246,6 +268,7 @@ pub struct ConnectionFilterConfig {
246268}
247269
248270#[ derive( Debug , Deserialize ) ]
271+ #[ allow( dead_code) ] // Config fields loaded from TOML
249272pub struct LoggingConfig {
250273 #[ serde( default = "default_log_level" ) ]
251274 pub level : String ,
@@ -361,6 +384,15 @@ fn default_max_reconnect_delay() -> u64 {
361384fn default_frame_buffer_size ( ) -> usize {
362385 1000
363386}
387+ fn default_connection_channel_size ( ) -> usize {
388+ 1024
389+ }
390+ fn default_circuit_breaker_window_secs ( ) -> u64 {
391+ 60
392+ }
393+ fn default_circuit_breaker_max_restarts ( ) -> usize {
394+ 5
395+ }
364396
365397/// Load configuration from file
366398pub fn load_config ( path : & Path ) -> Result < Config , ConfigError > {
@@ -455,6 +487,7 @@ fn validate_config(config: &Config) -> Result<(), ConfigError> {
455487
456488impl SourceConfig {
457489 /// Check if IP is allowed for outbound connections
490+ #[ allow( dead_code) ] // Public API method
458491 pub fn is_ip_allowed ( & self , ip : std:: net:: IpAddr ) -> bool {
459492 for cidr in & self . allowed_outbound . allowed_ips {
460493 if let Ok ( network) = cidr. parse :: < IpNetwork > ( ) {
@@ -469,6 +502,7 @@ impl SourceConfig {
469502
470503impl DestConfig {
471504 /// Check if source IP is allowed
505+ #[ allow( dead_code) ] // Public API method
472506 pub fn is_source_allowed ( & self , ip : std:: net:: IpAddr ) -> bool {
473507 for cidr in & self . connection_filter . allowed_source_ips {
474508 if let Ok ( network) = cidr. parse :: < IpNetwork > ( ) {
0 commit comments