Skip to content

A parser for the radiotap capture format

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

rossmacarthur/radiotap

 
 

Repository files navigation

radiotap

Crates.io Version Docs.rs Latest Build Status

A parser for the radiotap capture format.

Getting started

Add to your project with

cargo add radiotap

or directly editing your Cargo.toml

[dependencies]
radiotap = "2"

See the documentation here.

Usage

See examples/ for more.

// a capture off the wire or from a pcap file
let capture = &[0, 0, 0xd, 0x0, 0x5, 0, 0, 0, 0x78, 0x56, 0x34, 0x12, 0, 0, 0, 0, 0x30, /* ... */ ];

// parse the radiotap header from the capture into a `Header` struct
let header: radiotap::Header = radiotap::parse(capture)?;

// get the length of the entire header
let length = header.length();

// Unpack the `rate` field if it is present
if let radiotap::Header { rate: Some(rate), .. } = header {
    assert_eq!(rate.to_mbps(), 24.0);
}

// using the length we can determine the rest of the capture
// i.e. IEEE 802.11 header and body
let rest = &capture[length..];

License

Licensed under either of

at your option.

About

A parser for the radiotap capture format

Topics

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Stars

Watchers

Forks

Languages