pkts

![Latest Version] ![Documentation] ![pkts: rustc 1.65+] ![License Information]

pkts - an rscap submodule for creating, decoding and modifying packet layers


Rscap is a multi-purpose library for network packet capture/transmission and packet building. Its aims are twofold:

  1. To provide Rust-native platform tools for packet capture and transmission (comparable to libpcap, but written from the ground up in Rust)
  2. To expose a robust and ergonomic API for building packets and accessing/modifying packet data fields in various network protocols (like scapy, but with strong typing and significantly improved performance)

The pkts submodule focuses solely on (2)--it provides a packet-building API for a wide variety of network protocol layers. This library isn't meant to only cover Physical through Transport layers or stateless protocols--thanks to Sequence and Session types (which defragment/reorder packets and track packet state, respectively), any application-layer protocol can be easily captured and decoded.

Features

```rust use layers::{ip::Ipv4, tcp::Tcp};

let pkt = Ip::new() / Tcp::new(); pkt[Tcp].setsport(80); pkt[Tcp].setdport(12345); ```

License

The source code of this project is made available under the GNU General Public License, version 2.

Any further inquiries regarding licensing can be made to me[at]nathanielbennett[dotcom].