| Crates.io | xdp-util |
| lib.rs | xdp-util |
| version | 0.1.3 |
| created_at | 2025-07-09 05:01:16.973135+00 |
| updated_at | 2025-07-09 05:01:16.973135+00 |
| description | Utility library for XDP sockets |
| homepage | https://github.com/sudachen/xdp-rs |
| repository | https://github.com/sudachen/xdp-rs |
| max_upload_size | |
| id | 1744223 |
| size | 42,897 |
A utility library for XDP (eXpress Data Path) socket operations, networking, and packet processing in Rust. Provides helpers for netlink communication, packet header construction, routing, XDP program management, and MAC address lookup.
Add this to your Cargo.toml:
[dependencies]
xdp-util = "<latest-version>"
Then import and use the utilities:
use xdp_util::{get_ipv4_routes, write_udp_header_for, Router, mac_by_ifindex};
let routes = get_ipv4_routes(None)?;
let mac = mac_by_ifindex(2)?;
let mut router = Router::new(2);
router.refresh()?;
Full API docs are available at docs.rs/xdp-util.
This crate supports Rust 1.64 and above.
Licensed under either of
at your option.
Contributions are welcome! Please open issues or pull requests on GitHub.