xdp-util

Crates.ioxdp-util
lib.rsxdp-util
version0.1.3
created_at2025-07-09 05:01:16.973135+00
updated_at2025-07-09 05:01:16.973135+00
descriptionUtility library for XDP sockets
homepagehttps://github.com/sudachen/xdp-rs
repositoryhttps://github.com/sudachen/xdp-rs
max_upload_size
id1744223
size42,897
Alexey Sudachen (sudachen)

documentation

README

xdp-util

crates.io Documentation

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:

[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()?;

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

at your option.

Contribution

Contributions are welcome! Please open issues or pull requests on GitHub.

Commit count: 0

cargo fmt