Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rossmacarthur/radiotap
A parser for the radiotap capture format
https://github.com/rossmacarthur/radiotap
frame packet parser pcap radiotap
Last synced: 12 days ago
JSON representation
A parser for the radiotap capture format
- Host: GitHub
- URL: https://github.com/rossmacarthur/radiotap
- Owner: rossmacarthur
- License: apache-2.0
- Created: 2018-05-24T07:33:47.000Z (over 6 years ago)
- Default Branch: trunk
- Last Pushed: 2024-06-03T15:46:19.000Z (7 months ago)
- Last Synced: 2024-11-26T13:51:49.581Z (26 days ago)
- Topics: frame, packet, parser, pcap, radiotap
- Language: Rust
- Homepage:
- Size: 200 KB
- Stars: 12
- Watchers: 3
- Forks: 5
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE-APACHE
Awesome Lists containing this project
README
# radiotap
[![Crates.io Version](https://img.shields.io/crates/v/radiotap.svg?style=flat-square&color=blue)][crates]
[![Docs.rs Latest](https://img.shields.io/badge/docs.rs-latest-blue.svg?style=flat-square)][docs]
[![Build Status](https://img.shields.io/travis/rossmacarthur/radiotap/master.svg?style=flat-square)][travis]A parser for the [Radiotap](http://www.radiotap.org/) capture format.
## Getting started
Add to your project with
```bash
cargo add radiotap
```or directly editing your `Cargo.toml`
```toml
[dependencies]
radiotap = "1"
```See the documentation [here](https://docs.rs/radiotap).
## Example usage
See [examples/](examples/) for more.
The `Radiotap::from_bytes(&capture)` constructor will parse all present fields
into a Radiotap struct:```rust
let capture = [
0, 0, 56, 0, 107, 8, 52, 0, 185, 31, 155, 154, 0, 0, 0, 0, 20, 0, 124, 21, 64, 1, 213,
166, 1, 0, 0, 0, 64, 1, 1, 0, 124, 21, 100, 34, 249, 1, 0, 0, 0, 0, 0, 0, 255, 1, 80,
4, 115, 0, 0, 0, 1, 63, 0, 0
];let radiotap = Radiotap::from_bytes(&capture).unwrap();
println!("{:?}", radiotap.vht);
```If you just want to parse a few specific fields from the Radiotap capture you
can create an iterator using `RadiotapIterator::from_bytes(&capture)`:```rust
let capture = [
0, 0, 56, 0, 107, 8, 52, 0, 185, 31, 155, 154, 0, 0, 0, 0, 20, 0, 124, 21, 64, 1, 213,
166, 1, 0, 0, 0, 64, 1, 1, 0, 124, 21, 100, 34, 249, 1, 0, 0, 0, 0, 0, 0, 255, 1, 80,
4, 115, 0, 0, 0, 1, 63, 0, 0
];for element in RadiotapIterator::from_bytes(&capture).unwrap() {
match element {
Ok((field::Kind::VHT, data)) => {
let vht: field::VHT = field::from_bytes(data).unwrap();
println!("{:?}", vht);
},
_ => {}
}
}
```## License
This project is dual licensed under the Apache 2.0 License and the MIT License.
See [LICENSE-APACHE](LICENSE-APACHE) and [LICENSE-MIT](LICENSE-MIT) for more
details.[crates]: https://crates.io/crates/radiotap
[docs]: https://docs.rs/radiotap
[travis]: https://travis-ci.org/rossmacarthur/radiotap