pktparse

Crates.iopktparse
lib.rspktparse
version0.7.1
sourcesrc
created_at2016-11-21 17:00:46.21834
updated_at2021-12-26 16:04:24.676615
descriptionCollection of packet parsers
homepage
repositoryhttps://github.com/bestouff/pktparse-rs
max_upload_size
id7327
size61,841
Xavier Bestel (bestouff)

documentation

README

PktParse

This repository is just a bunch of packet parsing routines made with nom

Usage

Admitting your packet.data is an [u8]:

        if let Done(remaining, eth_frame) = ethernet::parse_ethernet_frame(packet.data) {
            if eth_frame.ethertype != EtherType::IPv4 {
                continue;
            }
            if let Done(remaining, ipv4_packet) = ipv4::parse_ipv4_header(remaining) {

For now the list of available parsers is rather short:

  • ethernet (with optional VLAN tag)
  • IPv4
  • IPv6
  • UDP
  • TCP
  • ICMP ... and we'll gladly accept contributions.

Last changes

  • IHL is not multiplied by 4 anymore
Commit count: 71

cargo fmt