12 releases (6 breaking)

0.7.1 Dec 26, 2021
0.7.0 Aug 27, 2021
0.6.1 Aug 2, 2021
0.6.0 Jul 3, 2021
0.1.0 Nov 21, 2016

#86 in Network programming

Download history 119/week @ 2021-10-03 95/week @ 2021-10-10 104/week @ 2021-10-17 209/week @ 2021-10-24 189/week @ 2021-10-31 186/week @ 2021-11-07 83/week @ 2021-11-14 61/week @ 2021-11-21 193/week @ 2021-11-28 100/week @ 2021-12-05 177/week @ 2021-12-12 39/week @ 2021-12-19 148/week @ 2021-12-26 453/week @ 2022-01-02 181/week @ 2022-01-09 170/week @ 2022-01-16

956 downloads per month
Used in less than 6 crates

LGPL-3.0

49KB
1.5K SLoC

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

Dependencies

~1MB
~21K SLoC

ˆ’Ča