mirror of https://github.com/aya-rs/aya
Allow to define programs as public functions (even in library crates) and then import them. For example, we can have library crate with `libfoo/src/lib.rs` containing: ```rust pub fn my_xdp_program(ctx: XdpContext) -> u32 { xdp_action::XDP_PASS } ``` And then a binary importing it: ```rust pub use libfoo::my_xdp_program; ``` This way, commonly used eBPF programs can be distributed as lib crates. Tested with: https://github.com/vadorovsky/aya-examples/tree/main/pub-progs Signed-off-by: Michal Rostecki <vadorovsky@gmail.com> |
2 years ago | |
---|---|---|
.. | ||
src | 2 years ago | |
Cargo.toml | 3 years ago |