pcapfile-reader
References
Requirements
$ sudo apt-get install libpcap-dev
Build pcapfile-reader
go build
Run pcapfile-reader
# Usage
$ ./pcap-reader -h
Usage of ./pcapfile-reader:
-i string
Path of PCAP input file
$ ./pcapfile-reader -i ../contrib/small_lo.pcap
TODOs
- Is it possible to check order of ethernet frame sequence? Seems to be unpossible (no sequence number in header).
Vendor golang dependencies (with go mod)
See: https://golang.org/ref/mod#vendoring
$ go help mod
Go mod provides access to operations on modules.
Note that support for modules is built into all the go commands,
not just 'go mod'. For example, day-to-day adding, removing, upgrading,
and downgrading of dependencies should be done using 'go get'.
See 'go help modules' for an overview of module functionality.
Usage:
go mod <command> [arguments]
The commands are:
download download modules to local cache
edit edit go.mod from tools or scripts
graph print module requirement graph
init initialize new module in current directory
tidy add missing and remove unused modules
vendor make vendored copy of dependencies
verify verify dependencies have expected content
why explain why packages or modules are needed
Use "go help mod <command>" for more information about a command.
$ go mod init
go: creating new go.mod: module github.com/eg5846/getting-started-with-pcap/pcapfile-reader
# Add some *.go files with includes
$ go get
go: finding module for package github.com/google/gopacket/pcap
...
$ go mod vendor
$ go mod tidy