| Crates.io | wsdf-derive |
| lib.rs | wsdf-derive |
| version | 0.1.0 |
| created_at | 2023-08-03 07:45:50.305932+00 |
| updated_at | 2023-08-03 07:45:50.305932+00 |
| description | Macro implementations for wsdf |
| homepage | https://github.com/ghpr-asia/wsdf |
| repository | https://github.com/ghpr-asia/wsdf |
| max_upload_size | |
| id | 933473 |
| size | 156,166 |
wsdf is a proc-macro based framework to generate Wireshark dissectors from your Rust data types. Using wsdf, you can write dissectors in a declarative way, all from within Rust.
Here is what a dissector for UDP looks like:
#[derive(wsdf::Protocol)]
#[wsdf(decode_from = [("ip.proto", 17)])]
struct UDP {
src_port: u16,
dst_port: u16,
length: u16,
checksum: u16,
#[wsdf(subdissector = ("udp.port", "dst_port", "src_port"))]
payload: Vec<u8>,
}
Check out the docs for more information. Some examples are also available, including a simple dissector for DNS, showcased below.

wsdf has been tested on Linux against Wireshark 4.0.
License
Licensed under either of Apache License, Version 2.0 or MIT license at your option.