support ohos (#974)

* support ohos

---------

Co-authored-by: FrankHan <2777926911@qq.com>
This commit is contained in:
韩嘉乐andFrankHan authored and GitHub committed 2025-07-02 09:44:45 +08:00
1 parent bf021a9ead
commit 01e491ec07
22 files changed
+668 -21

No files matched your search

+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);