support ohos (#974)

* support ohos

---------

Co-authored-by: FrankHan <2777926911@qq.com>
This commit is contained in:
韩嘉乐
2025-07-02 09:44:45 +08:00
committed by GitHub
parent bf021a9ead
commit 01e491ec07
22 changed files with 668 additions and 21 deletions
+2 -2
View File
@@ -16,14 +16,14 @@ struct InterfaceFilter {
iface: NetworkInterface,
}
#[cfg(target_os = "android")]
#[cfg(any(target_os = "android", target_env = "ohos"))]
impl InterfaceFilter {
async fn filter_iface(&self) -> bool {
true
}
}
#[cfg(target_os = "linux")]
#[cfg(all(target_os = "linux", not(target_env = "ohos")))]
impl InterfaceFilter {
async fn is_tun_tap_device(&self) -> bool {
let path = format!("/sys/class/net/{}/tun_flags", self.iface.name);