Crate scalpel

source ·
Expand description

A crate for dissecting and sculpting network packets.

Being able to dissect a stream of bytes from wire into a human or machine readable structures can be useful in many applications. scalpel is designed for such use cases. In other languages such use-cases are served by tools like gopacket or Wireshark.

Ability to dissect packets and looking at details of each of the protocols carried in the Packet can be quite useful for debugging protocol implementations, network issuess and so on. Also, having such ability in an API friendly way should allow -

  • Writing dissector for new protocols.
  • Using the dissection functionality in your own application.

Thus, the main focus of scalpel is to provide API based framework for dissecting packets such that it’s possible for anyone to write a dissector for a new protocol. scalpel natively supports dissection for a set of widely used protocols out of the box. See layers modules for supported protocols.

A Basic unit in a scalpel is a Packet structure that represents a dissected Packet from the wire. This structure carries information about the dissected protocols, each of the protocol that is dissected implements a trait called Layer. See Packet for details.

Opt-in Features

  • python-bindings: Python bindings for the scalpel Rust API. Currently support is to generate Packet structure in Python.

Modules

Error types for scalpel.
‘Layer’ trait
Scalpel Layers
Packet Structure
All types that we are supporting

Structs

Packet is a structure in scalpel containing the decoded data and some metadata.

Statics

Traits

Layer Trait defines a ‘Layer’ in a Packet

Functions

Register Default protocol handlers.