Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mmynk/rust-tc
A Rust library for reading traffic control (tc) messages from kernel
https://github.com/mmynk/rust-tc
netlink qdisc rtnetlink rust traffic-control
Last synced: about 1 month ago
JSON representation
A Rust library for reading traffic control (tc) messages from kernel
- Host: GitHub
- URL: https://github.com/mmynk/rust-tc
- Owner: mmynk
- License: apache-2.0
- Created: 2023-10-11T18:04:23.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-11-22T19:09:49.000Z (about 1 year ago)
- Last Synced: 2024-04-24T16:36:44.094Z (9 months ago)
- Topics: netlink, qdisc, rtnetlink, rust, traffic-control
- Language: Rust
- Homepage:
- Size: 64.5 KB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 24
-
Metadata Files:
- Readme: README.md
- License: LICENSE-APACHE
Awesome Lists containing this project
README
# rust-tc
`rust-tc` provides a pure Rust API for interacting with the [netlink](https://www.kernel.org/doc/html/latest/userspace-api/netlink/intro.html) based Linux Traffic Control ([`tc`](http://man7.org/linux/man-pages/man8/tc.8.html)) subsystem of [`rtnetlink`](http://man7.org/linux/man-pages/man7/rtnetlink.7.html).
This library is very much in progress. It only supports a small subset of `classless` and `classful` [qdiscs](https://tldp.org/HOWTO/Traffic-Control-HOWTO/components.html#c-qdisc). Also, the library only supports read at the moment.
## Usage
```rust
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> = 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
* Apache License, Version 2.0
([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0)
* MIT license
([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT)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.