#netlink #linux #linux-kernel #rtnetlink #tc

netlink-tc

A Rust library for interacting with the Linux Traffic Control (tc) subsystem using Netlink

4 releases

0.0.4 Oct 30, 2023
0.0.3 Oct 30, 2023
0.0.2 Oct 26, 2023
0.0.1 Oct 23, 2023

#393 in Unix APIs

28 downloads per month

MIT/Apache

77KB
2K SLoC

rust-tc

rust-tc provides a pure Rust API for interacting with the netlink based Linux Traffic Control (tc) subsystem of rtnetlink.

This library is very much in progress. It only supports a small subset of classless and classful qdiscs. Also, the library only supports read at the moment.

Usage

use netlink_tc as tc;

fn main() {
    // Get list of qdiscs
    let qdiscs = tc::qdiscs::<tc::Netlink>().unwrap();

    // Get list of classes
    let classes = tc::classes::<tc::Netlink>().unwrap();

    // Get class for given interface
    let class = tc::class::<tc::Netlink>("eth0").unwrap();
}

TODO

  • Add support for all qdiscs and classes.
  • Add support for write, update and delete.

License

Licensed under either of

at your option.

Contribution

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

Dependencies

~2–2.9MB
~65K SLoC