# rust-libtipc **Repository Path**: openkylin/rust-libtipc ## Basic Information - **Project Name**: rust-libtipc - **Description**: No description available - **Primary Language**: Unknown - **License**: Apache-2.0 - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 2 - **Created**: 2026-06-16 - **Last Updated**: 2026-07-23 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # libtipc - 纯 Rust 实现的 TIPC 库 > **用途**:本库供 **TA(Trusted Application)** 使用。**CA(Client Application)** > 使用 Trusty 官方的 `libc-trusty`(C)或 `libtrusty`(Rust),不需要链接本库。 ## 简介 libtipc 是纯 Rust 实现的 TIPC(Trusty IPC)通信库,支持 x-kernel 和 Trusty LK 双平台, 对标 Google Trusty 官方的 `tipc` crate。 两个平台均使用 Rust `std`,通过 feature 区分 syscall 号: - `x-kernel`(默认):x-kernel syscall 号,`aarch64-unknown-linux-musl` target - `lk`:Trusty LK syscall 号,`aarch64-unknown-trusty` target(AOSP 构建) 提供三层 API: - **Rust `service` API**:`Handle`、`Manager`、`Service`、`UnbufferedService`,用法与官方一致 - **Rust `raw` API**:`EventLoop`、`HandleSetWrapper`,基于 `Arc>`,适合 RPC 场景 - **C FFI 接口**(`extern "C"`):导出为 staticlib(`staticlib-shim` 子 crate),供 C/C++ TA 调用,兼容 `libtrusty.so` 接口 ## 分层架构 ```text Rust TA C TA CA (libc-trusty) │ │ │ ▼ ▼ │ handle / raw / service c_api (extern "C") (不使用本库) │ │ ▼ ▼ api (安全包装) ──-> ffi (tipc-syscall) │ ▼ syscall (内联汇编) -> 内核 ``` ## 构建 ```bash # x-kernel 平台(默认),musl target cargo build --release --target aarch64-unknown-linux-musl # Trusty LK 平台(需 -Zbuild-std) cargo build --release --target aarch64-unknown-trusty -Zbuild-std=core,alloc --features lk # 本地开发 & 测试 cargo build cargo test cargo clippy --all-targets --target aarch64-unknown-linux-musl ``` ## 许可证 Apache-2.0 · Copyright 2026 KylinSoft Co., Ltd.