MCPcopy Index your code
hub / github.com/Gbps/plugshark

github.com/Gbps/plugshark @0.0.1

Chat with this repo
repository ↗ · DeepWiki ↗ · release 0.0.1 ↗ · + Follow
76 symbols 122 edges 4 files 54 documented · 71%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

plugshark - An experimental Wireshark dissector framework for Rust

Plugshark provides a framework for wirting Wireshark dissector plugins. Projects utilizing this framework can build dynamic libraries that can be loaded into Wireshark to build protocol analyzers.

Plugshark is (currently) an unsafe plugin framework and provides no memory safety guarentees. While the project is written to be memory safe, the Wireshark plugin interface does not always establish clear rules on memory management. Therefore, the interfaces are marked unsafe until proper testing is performed.

All users of the framework are created with the understanding that this is still experimental.

How to Use

Check out the simple-example project in this repo for a basic template to extend.

Motivation

Currently there are only two official options for writing Wireshark dissectors, either using the poorly documented C API or the less performant Lua API.

There exists a Rust project for crating dissectors called WSDF, but it mainly focuses on writing analyzers from Rust structures using a declarative method. This doesn't work so well when you have more complex dissector requirements, such as protocols that work entirely on a bitstream level.

While the C API supports a wide range of use cases, the API is clunky to use. It is clear that the plugin API requires a strong understanding of the internals of Wireshark.

The hope of this project is to provide a wrapper that gives relatively good access to the core functionality of the dissector C API from Rust. Not all features are supported, and PRs are welcome.

License

Licensed under either of Apache License, Version 2.0 or MIT license at your option.

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this crate by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Core symbols most depended-on inside this repo

alloc_string
called by 8
src/wireshark_protocol.rs
enum_to_index_position
called by 6
src/wireshark_protocol.rs
to_temp_cstring_fast
called by 5
src/wireshark_protocol.rs
add_field
called by 5
src/wireshark_protocol.rs
to_u32
called by 3
src/defines.rs
get_global_plugin
called by 3
src/wireshark_protocol.rs
with_field_type
called by 2
src/wireshark_protocol.rs
with_display
called by 2
src/wireshark_protocol.rs

Shape

Method 53
Class 10
Enum 7
Function 6

Languages

Rust100%

Modules by API surface

src/wireshark_protocol.rs66 symbols
src/defines.rs8 symbols
simple-example/src/lib.rs2 symbols

For agents

$ claude mcp add plugshark \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact