xdp-util
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.
Features
- Netlink utilities for querying routes, neighbors, and network interfaces
- Packet header construction (e.g., UDP headers)
- Routing and next-hop resolution
- XDP program management helpers
- MAC address lookup by interface index
Usage
Add this to your Cargo.toml:
[]
= "<latest-version>"
Then import and use the utilities:
use ;
let routes = get_ipv4_routes?;
let mac = mac_by_ifindex?;
let mut router = new;
router.refresh?;
Documentation
Full API docs are available at docs.rs/xdp-util.
Minimum Supported Rust Version
This crate supports Rust 1.64 and above.
License
Licensed under either of
- Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.
Contribution
Contributions are welcome! Please open issues or pull requests on GitHub.