Skip to content
/ rust-tc Public

A Rust library for reading traffic control (tc) messages from kernel

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT
Notifications You must be signed in to change notification settings

mmynk/rust-tc

Repository files navigation

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_packet_core::NetlinkMessage;
use netlink_packet_route::RtnlMessage;
use netlink_tc as tc;

fn main() {
    // Retrieve netlink messages using `netlink-packet-route`.
    // See `examples` for more details.
    let messages: Vec<NetlinkMessage<RtnlMessage>> = vec![]; // init with netlink messages

    // Get list of tc qdiscs or classes
    let qdiscs = OpenOptions::new()
        .fail_on_unknown_attribute(false)
        .fail_on_unknown_option(false)
        .tc(messages)
        .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.

About

A Rust library for reading traffic control (tc) messages from kernel

Topics

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Stars

Watchers

Forks

Languages