pcap2go

command module
v0.0.0-...-e4e2a53 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 9, 2024 License: CC0-1.0 Imports: 5 Imported by: 0

README

pcap2go - Create go test-data from pcap files

This is (very) small utility program that convert pcap files to go [][]byte declarations. It's intended for unit-tests to test packet parsing with real packets.

A normal use-case is to append a [][]byte variable with test-data to your unit test.

# (capture data for instance with "tcpdump -ni eth0 -w my-capture.pcap udp")
pcap2go -variable udpPackets my-capture.pcap >> packet_test.go

Test with:

go build -o pcap2go pcap2go.go
./pcap2go udp.pcap

HW offload

To capture fragments it is often necessary to turn off HW offload (even on virtio devices):

ethtool -K eth1 gro off gso off tso off

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL