Apache License 2.0

项目介绍

aya-rs/aya 是一个托管在 GitHub 上的开源项目,主要使用 Rust 编写,采用 Apache License 2.0 许可证,目前获得 4.9k 个 Star、484 次 Fork。

仓库全名
aya-rs/aya
开源许可证
Apache License 2.0
Star 数
4.9k
Fork 数
484
未关闭 Issue
217

README 摘要

[crates-url]: https://crates.io/crates/aya [build-url]: https://github.com/aya-rs/aya/actions/workflows/ci.yml [book-url]: https://aya-rs.dev/book [gurubase-url]: https://gurubase.io/g/aya API Documentation [git-api-docs]: https://docs.aya-rs.dev [api-docs]: https://docs.rs/aya Community Join [the conversation on Discord][chat-url] to discuss anything related to Aya or discover and contribute to a list of [Awesome…

完整内容见 GitHub 原始 README 或本页 。

常见问题

aya 用什么语言开发?

主要使用 Rust 编写,采用 Apache License 2.0 许可证,目前有 4.9k 个 Star。

aya 可以免费商用吗?

仓库采用 Apache License 2.0 许可证,可免费使用与修改,商业使用请遵守许可证条款(例如保留版权声明与许可声明)。

如何获取 aya 的源码?

可以直接克隆仓库:git clone https://github.com/aya-rs/aya.git;安装与运行步骤见仓库 README。

aya 最近还在维护吗?

仓库最近一次更新为 17 小时前,当前有 217 个未关闭 Issue;Star 数为 4.9k,可作为社区活跃度的参考。

关于

GitHub 原始描述(英文)

Aya is an eBPF library for the Rust programming language, built with a focus on developer experience and operability.

描述取自 GitHub 官方 API,保持仓库作者书写的原文。

简要分析

热度分
5904
价值分
3075
活跃状态
活跃

语言占比

C
Python
Ruby
Rust
Shell
Starlark

README

Aya

Crates.io License Build status Book Gurubase

API Documentation

Unreleased Documentation Documentation

Community

Discord Awesome

Join the conversation on Discord to discuss anything related to Aya or discover and contribute to a list of Awesome Aya projects.

Overview

eBPF is a technology that allows running user-supplied programs inside the Linux kernel. For more info see What is eBPF.

Aya is an eBPF library built with a focus on operability and developer experience. It does not rely on libbpf nor bcc - it’s built from the ground up purely in Rust, using only the libc crate to execute syscalls. With BTF support and when linked with musl, it offers a true compile once, run everywhere solution, where a single self-contained binary can be deployed on many linux distributions and kernel versions.

Some of the major features provided include:

  • Support for the BPF Type Format (BTF), which is transparently enabled when supported by the target kernel. This allows eBPF programs compiled against one kernel version to run on different kernel versions without the need to recompile.
  • Support for function call relocation and global data maps, which allows eBPF programs to make function calls and use global variables and initializers.
  • Async support with both tokio and async-std.
  • Easy to deploy and fast to build: aya doesn’t require a kernel build or compiled headers, and not even a C toolchain; a release build completes in a matter of seconds.

Example

Aya supports a large chunk of the eBPF API. The following example shows how to use a BPF_PROG_TYPE_CGROUP_SKB program with aya:

use std::fs::File;
use aya::Ebpf;
use aya::programs::{CgroupSkb, CgroupSkbAttachType, CgroupAttachMode};

// load the BPF code
let mut ebpf = Ebpf::load_file("ebpf.o")?;

// get the `ingress_filter` program compiled into `ebpf.o`.
let ingress: &mut CgroupSkb = ebpf.program_mut("ingress_filter")?.try_into()?;

// load the program into the kernel
ingress.load()?;

// attach the program to the root cgroup. `ingress_filter` will be called for all
// incoming packets.
let cgroup = File::open("/sys/fs/cgroup/unified")?;
ingress.attach(cgroup, CgroupSkbAttachType::Ingress, CgroupAttachMode::AllowOverride)?;

Contributing

Please see the contributing guide.

License

Aya is distributed under the terms of either the MIT license or the Apache License (version 2.0), at your option.

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this crate by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

评论

暂无评论