@@ -102,6 +102,9 @@ pub struct FeatureWireguard {
102102 /// Configurable wireguard polling period
103103 #[ serde( default ) ]
104104 pub polling : FeaturePolling ,
105+ /// Configurable wireguard interface health monitor
106+ #[ serde( default ) ]
107+ pub interface_health : FeatureInterfaceHealth ,
105108 /// Configurable up/down behavior of WireGuard-NT adapter. See RFC LLT-0089 for details
106109 #[ serde( default ) ]
107110 pub enable_dynamic_wg_nt_control : bool ,
@@ -148,6 +151,23 @@ pub struct FeaturePersistentKeepalive {
148151 pub stun : Option < u32 > ,
149152}
150153
154+ /// Configurable interface health monitor
155+ #[ derive( Copy , Clone , Debug , PartialEq , Eq , Serialize , Deserialize , SmartDefault ) ]
156+ #[ serde( default ) ]
157+ #[ cfg_attr( test, derive( proptest_derive:: Arbitrary ) ) ]
158+ pub struct FeatureInterfaceHealth {
159+ /// Minimum time separation between UAPI failures required to classify
160+ /// a failure as non-transient. (in seconds) [default 10s]
161+ #[ default( 10 ) ]
162+ pub transient_failure_separation_threshold : u32 ,
163+
164+ /// Maximum poll gap before treating libtelio as suspended for transient failure filtering
165+ /// for WireguardNT. Recommended to be slightly higher than twice the FeaturePolling.wireguard_polling_period
166+ /// (in seconds) [default 5s]
167+ #[ default( 5 ) ]
168+ pub uapi_poll_suspension_threshold : u32 ,
169+ }
170+
151171/// Configurable Wireguard polling period
152172#[ derive( Clone , Debug , PartialEq , Eq , Serialize , Deserialize , SmartDefault ) ]
153173#[ serde( default ) ]
@@ -698,6 +718,10 @@ mod tests {
698718 "wireguard_polling_period": 1000,
699719 "wireguard_polling_period_after_state_change": 50
700720 },
721+ "interface_health": {
722+ "transient_failure_separation_threshold": 44,
723+ "uapi_poll_suspension_threshold": 55
724+ },
701725 "enable_dynamic_wg_nt_control": true,
702726 "skt_buffer_size": 123456,
703727 "inter_thread_channel_size": 123456,
@@ -801,6 +825,10 @@ mod tests {
801825 wireguard_polling_period: 1000 ,
802826 wireguard_polling_period_after_state_change: 50
803827 } ,
828+ interface_health: FeatureInterfaceHealth {
829+ transient_failure_separation_threshold: 44 ,
830+ uapi_poll_suspension_threshold: 55
831+ } ,
804832 enable_dynamic_wg_nt_control: true ,
805833 skt_buffer_size: Some ( 123456 ) ,
806834 inter_thread_channel_size: Some ( 123456 ) ,
0 commit comments